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

[494 byte] By [MerlinRosinaa] at [2007-10-3 5:23:16]
# 1

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")

TimTheEnchantora at 2007-7-14 23:30:21 > top of Java-index,Java Essentials,Java Programming...
# 2
Hi,Use can use split. e.g.String name = actualfile.split("\\.")[0];Kaj
kajbja at 2007-7-14 23:30:21 > top of Java-index,Java Essentials,Java Programming...
# 3

> 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

pbrockway2a at 2007-7-14 23:30:21 > top of Java-index,Java Essentials,Java Programming...