How can i remove the last element without using StringBuilder data
while(br.ready){
String s = br.readLine();
String[] str = s.split(" ");
for(String s1 : str){
if(s1,length()>6){
bw.write(s1+",");
}
}
}
it almost does the same thing but can't delete the last element.