-
Trimming A Javascript Variable
I have a javascript variable var newLink = "Bob "; which comes from a xmlhttp.responseText.
I could clean-up the string in my php script. I could also slice at " ,", but I'd like to know how to trim "Bob " with js.
How is that done?
-
split(' ').join(''); did the trick. It's hard to how when there's a tailor made method and when some assembly is required as I learn javascript.
-
SitePoint Wizard
Here's an interesting page on a number of the different ways of trimming in javascript: http://blog.stevenlevithan.com/archi...rim-javascript
-
Thank-you Immerse. Happy Holidays.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks