use split() for splitting a string

Posted by Hamed on Stack Overflow See other posts from Stack Overflow or by Hamed
Published on 2010-05-03T09:08:44Z Indexed on 2010/05/03 9:18 UTC
Read the original article Hit count: 291

Filed under:

Hi again... Guys I'd asked 2 questions before and I'd said that I want to split a string like below:

Input string:

a=>aa|b=>b||b|c=>cc

and the output:

a=>aa

b=>b||b

c=>cc

some guys answer my question but they use .Match():

var matches = "a=>aa|b=>b||b|c=>cc".match(/(?:[^|]|\|\|)+/g)

but I need to use the .split() method and store the outputs in an array.

please help me guys... It's so critical...

Thanks...

© Stack Overflow or respective owner

Related posts about JavaScript