[Solved] split String in an array


You can simply use the String#split method on any element of the array, whose delimiter can be any character. Here is an example where I chose : to be the delimiter.

String[] information = { "Castiel Li:123-456-7890" };

String[] args = information.split(":");

String name = args[0];
String phoneNumber = args[1];

solved split String in an array