Back
I was trying to split a string something like:
'intellipaat~123 Street~Apt 2~Bangalore~IN~70005'
Can anyone help me how I can able to split this string?
You can use the split function, in able to split the string:
var input = 'intellipaat~123 Street~Apt 2~Bangalore~IN~70005';var fields = input.split('~');var name = fields[0];var street = fields[1];// etc.
var input = 'intellipaat~123 Street~Apt 2~Bangalore~IN~70005';
var fields = input.split('~');
var name = fields[0];
var street = fields[1];
// etc.
I hope this will help.
Want to become a Java expert? join Java Certification now!!
31k questions
32.8k answers
501 comments
693 users