I want to split the string into 2 parts (it will always be a array divide into two parts - or two elements) whenever a vertical bar |
first case).
For example: I have a string
var string = "João|23anos";
I can give string.split("|")
and return will be an array ["João", "23 anos"]
. But I'd like to give split only in the first case of vertical bar |
and copy the rest of string to the array ;
For example:
var string = "João|||23anos|";