Answers for "What is the purpose of the split on a string?"

2

split on . in java

String textfile = "ReadMe.txt";
String filename = textfile.split(".")[0];
String extension = textfile.split(".")[1];
Posted by: Guest on October-15-2020
0

split string

String[] result = "this is a test".split("\\s");
     for (int x=0; x<result.length; x++)
         System.out.println(result[x]);
Posted by: Guest on June-11-2021

Code answers related to "What is the purpose of the split on a string?"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language