Stripping characters from the end of a string

I have a string which looks like this:

www.webpage.com/index.html

I need to strip the 'index.html' part from it.

What is the best way of doing this and storing it into another string?

Converting to a char array and using loops seems a messy way of doing it.

Thanks

[303 byte] By [Unconditionala] at [2007-11-26 12:20:33]
# 1
Use the functions on the String class like:lastIndexOf()and subString()
zadoka at 2007-7-7 15:10:49 > top of Java-index,Archived Forums,Socket Programming...
# 2
Use indexOf to find the first instance of /, then take the substring up the that index. Assuming of course that the string you're processing always has that pattern. If it will be a general url you're processing, then use the getter methods of the URL class to get the parts you
hunter9000a at 2007-7-7 15:10:49 > top of Java-index,Archived Forums,Socket Programming...
# 3
String line = "www.webpage.com/index.html";String result = line.replaceAll("/.*","");
sabre150a at 2007-7-7 15:10:49 > top of Java-index,Archived Forums,Socket Programming...