Opened on 12/08/2014 at 05:22:05 PM
Closed on 12/09/2014 at 06:51:05 AM
Last modified on 12/09/2014 at 06:51:33 AM
#1675 closed change (fixed)
Use String.trim() to strip leading/trailing whitespaces
| Reported by: | sebastian | Assignee: | sebastian |
|---|---|---|---|
| Priority: | P4 | Milestone: | Adblock-Plus-2.6.7-for-Firefox |
| Module: | Adblock-Plus-for-Firefox | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Platform: | Unknown | |
| Ready: | yes | Confidential: | no |
| Tester: | Verified working: | no | |
| Review URL(s): | |||
Description
Background
Currently most of our code is using .replace(/^\s+/, "").replace(/\s+$/, "") in order to remove leading and trailing whitespaces in a string. However since Firefox 3.5, Chrome 23 and Safari 5, there is String.trim() which does the same in a more readable and more efficient way.
What to change
Use .trim() to remove leading and trailing whitespaces, where currently regular expressions are used.
Attachments (0)
Change History (4)
comment:1 Changed on 12/08/2014 at 05:22:45 PM by sebastian
comment:2 Changed on 12/08/2014 at 05:24:24 PM by sebastian
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:3 Changed on 12/09/2014 at 06:51:05 AM by sebastian
- Resolution set to fixed
- Status changed from reviewing to closed
comment:4 Changed on 12/09/2014 at 06:51:33 AM by sebastian
- Milestone set to Adblock-Plus-for-Firefox-next
Note: See
TracTickets for help on using
tickets.

See #1674 for the respective Chrome/Opera/Safari issue.