JS - Remove whitespaces in two ways

by barkkathulla 2014-03-01 15:02:01

1.Remove top and end spaces only


mystring=mystring.trim();


2.trim all spaces in a string


mystring =mystring.replace(/s/g, '');



911
like
0
dislike
0
mail
flag

You must LOGIN to add comments