Subj : String functions? To : Sampsa From : LaRRy LaGoMoRpH Date : Wed Feb 04 2015 10:28 pm Re: String functions? By: Sampsa to All on Wed Jan 28 2015 03:03 pm > I've been dabbling in Synchronet JS lately and noticed that the methods that > Syncro provides seem to be a subset of those in the standard. > > For example, there is no trim() method. > > My immediate question is - how do I trim whitespace from a string like trim( > does? > > Is there a separate string handling object or something? > > It's easy enough to make this function using a regex, in fact if you search google for "javascript trim" it will come up on the w3schools page at the bottom for where it is unsupported I'm just gonna type it in but you can find a tidbit more info there. function trimString(str){ return str.replace(/^\s+|\s+$/gm,''); } I could have possibly typed that wrong. Giving you the answer cause you owned up to your boner in the other forum(s?). If that doesn't work check the page, cause it should but I may have typed the regex wrong. ll morph G futureland.grudgemirror.com LaRRy LaGoMoRpH\-/ O =M= 'not your average board check it out' /-\ --- þ Synchronet þ Futureland.Grudgemirror.Com ** LIVE ** Music and .