how to replace multiple occurrences of and <br>
at start of the string with javascript regex?
views:
59answers:
2
+3
A:
myString = myString.replace(/^( |<br>)+/, '');
... where /
.../
denotes a regular expression, ^
denotes start of string, ($nbsp;|<br>)
denotes "
or <br>
", and +
denotes "one or more occurrence of the previous expression". And then simply replace that full match with an empty string.
David Hedlund
2010-08-09 06:27:46
thanks..it works great !!!
Rohan
2010-08-09 09:42:06