-
split a string by 3 condition .......pls help
hello,
i want to split a string by 3 condition.
1)<font style="color: blue; background-color: yellow;">
2)</font>
3)rest of the string.
suppose string is as bellow ........(string is created dynamically so len is not specific)
<font style="color: blue; background-color: yellow;"> hi </font> hihisadsadasdfsdffasdf
<font style="color: blue; background-color: yellow;"> hi</font>
output
suppose a is array :
a[0]=><font style="color: blue; background-color: yellow;">
a[1]=>hi
a[2]=></font>
a[3]=>hihisadsadasdfsdffasdf
a[4]=><font style="color: blue; background-color: yellow;">
a[5]=>hi
a[6]=></font>
<font style="color: blue; background-color: yellow;"> & </font> will remain same only the string will change from the whole string.
please tell me how to split ..........................................
-
-
Now, I don't extremely get how you want to split the string, but take a look at the split() function:
http://www.w3schools.com/jsref/jsref_split.asp
And regular expressions:
http://www.javascriptkit.com/jsref/regexp.shtml
-
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