package string;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.StringTokenizer;
public class TestStringTokenizer {
public static void main(String[] args) throws FileNotFoundException, IOException {
Dokumen test1 = new Dokumen();
test1.setFile(new File("test.txt"));
test1.baca();
String teks = test1.getTeks();
StringTokenizer test = new StringTokenizer(teks, "[\n\r;]");
while(test.hasMoreTokens()){
System.out.println(test.nextToken());
}
}
}
Tidak ada komentar:
Posting Komentar