java split up a comma separated values code example
Example 1: how to read comma separated values in java
try(BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream("yourFile.csv"),StandardCharsets.UTF_8))){
String line;
while((line=br.readLine())!=null){
String[] split=line.split(",");
//use the data here
}
}
Example 2: separate string by comma java
String names = "prappo,prince";
String[] namesList = names.split(",");