I almost have my program complete, at the moment I am working on the last part of this program.
I have in my program an option for the user to select a output file through a GUI screen.
Now I would like the program to look if there is a certain extension behind the file. (.xlsx)
If yes: continue.
else: put .xlsx behid it.
Now I was thinking of using lastIndexOf() as I have used indexOf somewhere else with succes.
But I can't get the lastIndexOf to start working, becasue of the folowing error:
outputFileName1 cannot be resolved to a type
outputFileName1 = defined as a String
String outputFileName1 = "";
Now I looked it up and the input needs to be a string.
Now this string.lastIndexOf(".xlsx") works.
But not when I put it inside an if loop.
Is it not usable in a if loop or something?