splitting a file name into parts
Hai,
I want to rename a file to have a different extension, but I can't find
anything in java.io.
This is my Actual String
String actualfile =" AH512bce80e642c58d39958cae95a19346.jsp"
I would like to split the file name only not extension.
i want to add the new extension that is .ivwr instead of jsp.
I was try String funtion also... but i cant get the solution
Pls help me...to get the file name only.
Thanks
Merlin Roshina
File extension is in fact not a standard concept (you can have no extension, you can have multiple dots in filename, etc.)
That's why (I think) this concept is not included in the language.actualfile.replaceAll("\\.jsp\\z", ".ivwr")
> I want to rename a file to have a different extension
Use theString methods: lastIndexOf(String), substring(int,int) and
String concatenation.
> but I can't find anything in java.io.
As indicated the problem involves strings and nothing much to do
with java.io. Further, there is no concept of "extension" captured by
java.io.File for example. It really isn't clear what the file extension is
in the case of foo.tar.gz