1var input = 'john smith~123 Street~Apt 4~New York~NY~12345';
2
3var fields = input.split('~');
4
5var name = fields[0];
6var street = fields[1];
1var str= "12344A56789";
2var splitted = str.split('4A'); //this will output ["1234", "56789"]
3var first = splitted[0]; //"1234"
4var second = splitted[1]; //"56789"
5console.log('First is: ' + first + ', and second is: ' + second);