Feedback on: irt.org FAQ Knowledge Base Q241
Worth:
Worth reading
Length:
Just right
Technical:
Just right
Comments:
When I use this code to strip a string ending with a close paren, it strips the close paren.
" mouseover=control(evt) " gets stripped to "mouseover=control(evt"
Using FireFox 2.005 on fedora 7. The fix for now will be to make sure every command ends in a delimiter so there is no ws, but this is dangerous. I'm writing an environment for others to play in.
Worth:
Length:
Technical:
Comments:
The regexp solution strips not only white spaces, but anything non-latin and non-alphabet (didn't test too much, but so it seems). Here's a working example: mystring.replace(/(^s*|s*$)/g, '');
Jay Dunnings suggestion on the other hand obviously strips ALL white spaces, not just the leading and trailing.
So, out of the three here, only the first one does what it's supposed to do.