Question : java split string
Answered by : n0rther
String yourString = "Hello/Test/World";
String[] strings = yourString.split("/" /*<- Regex */);
Output:
strings = [Hello, Test, World]
Source : | Last Update : Wed, 24 Jun 20
Question : split method in java
Answered by : lonely-ladybird-mhrnh0jg5x6j
public class SplitExample2 { public static void main(String args[]) { String str = "My name is Chaitanya"; //regular expression is a whitespace here String[] arr = str.split(" "); for (String s : arr) System.out.println(s); }
}
Source : https://beginnersbook.com/2013/12/java-string-split-method-example/ | Last Update : Sat, 30 May 20