Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular Expressions syntax question 1

Status
Not open for further replies.

Suppy

Technical User
Jul 22, 2002
12
RO
Hy.
I am a rookie in Javascript and i need your help.
I need a regular expression line to do the following:
i have a string like :" one thing " and i need a regular expression to transform it in "onething" In other words triming wihtout any spaces in front, between or behind words.
 
hi Suppy,

this should work:

var oldString = " one thing or another ";
var newString = oldString.replace(/\s/g,"");

=========================================================
if (!succeed) try();
-jeff
 
Thank you very much for your help,jeff.
It works just fine.
I had a script from a friend but it was to big and i couldn't use it.
Regards,Suppy.
PS: by the way you deserve a star. here it is
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top