Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: irt.org FAQ Knowledge Base Q241

Feedback on: irt.org FAQ Knowledge Base Q241

Sent by on Wednesday August 29, 2007 at 14:03:15 - feedback #4964

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.




Sent by Riku Fabrick on Friday October 24, 2008 at 11:49:47 - feedback #5325

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.




©2018 Martin Webb