java - How to split an Acronym from it's Meaning in a String -
this question has answer here:
i want able split string contains acronym , it's meaning in 2 strings.
for example:
string main = "bc before christ";
//do something.
string acronym = "bc";
string meaning = "before christ";
any appreciated, thanks! :)
you can use string.split
this. there variant of split
takes second parameter dictates how many times split (the size of returned array).
string arr[] = main.split(" ", 2); string acronym = arr[0]; string meaning = arr[1];
Comments
Post a Comment