hi
for some reason my string split is not working. i am trying to check if a file exists in a directory and then add a number to the file so it does not try to overwrite the existing file. the method looks like this..
thanksCode:public String fileExists(String path, String fileName){
File fileCheck = new File(path.trim()+"\\"+fileName.trim());
int count=0;
String newFileName="";
String[] fileSplit=null;
while(true){
if (fileCheck.exists()){
count++;
fileSplit = fileName.split(".");
newFileName=fileSplit[0]+Integer.toString(count)+fileSplit[1];
}else{
break;
}
}
return newFileName;
}
edit: oh yes when i split the file the fileSplit variable just shows nothing.

