0

I need to take arguments and change the extensio of the file for writting but I get java.lang.ArrayIndexOutOfBoundsException: 1
Why?

Is there any better way?

// change file name for saving the output file

        int dot = inputFile.lastIndexOf('.'); // check for the dot
        String baseName = (dot == -1) ? inputFile : inputFile.substring(0, dot); // split the input file name
        String outputFile = baseName+".bin"; // save the file weith bin extension

Edited by mehnihma: wrong1

1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by mehnihma
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.