java - Split a String into Multiple Strings (When a certain character occurs) -
i need write method takes string , separates string string[] every time there ;
. example, if give test;test2;test 3
, should give me string[] containing test
, test2
, , test 3
edit: sorry guys, blanked out. mods, feel free delete it.
string.split()
friend , answer.
"test;test2;test 3".split(";")
return array consisting of strings "test", "test2", "test 3"
.
Comments
Post a Comment