StringTokenizer example
=============================================== package testjava; import java.io.File; import java.util.StringTokenizer; public class TStringTokenizer { public static void main(String[] args) { //The following is one example of the use of the tokenizer. The code: File curDir ; String fileName = ""; String chkFile = ""; try { curDir = new File(System.getProperty("user.dir")+System.getProperty("file.separator")+"src"+System.getProperty("file.separator")+"testjava"); for(File f : curDir.listFiles()){ fileName = f.getName().toLowerCase(); StringTokenizer st = new StringTokenizer(fileName , "."); while(st.hasMoreTokens()){ st.nextToken(); if(st.countTokens()== 1){ chkFile = st.nextToken().toLowerCase(); } }//while if("jpg".equals(chkFile)||"jpeg".equals(chkFile)) System.out.println("ok jpg"); else ...