Reputation: 8141
Is it possible to split a string twice with regex? For example, say I have the string:
[email protected]|fname|lname
how can I split to the result is:
[email protected],fname,lname
thanks...
Upvotes: 0
Views: 429
Reputation: 12417
You want to search and replace the '|' to ' , '.
Why dont you use replace()
http://www.w3schools.com/jsref/jsref_replace.asp
Upvotes: 0
Reputation: 887285
You can manually remove the prefix:
str.substr(str.indexOf('=') + 1)
.split('|')
Upvotes: 5