String operations

Hi,

I have string

http://127.0.0.1/

I later add some more text and build a complete URL to fetch a webpage. If the user forgets to enter the last backslash "/" I want to add it by my self.

How do I detect in this string if there is a slash at the end. strurl contains my url

String str = strurl.substring(strurl.lastIndexOf("/") );

might not help as there are two slashes after http.

thanks

@debug

[478 byte] By [@debuga] at [2007-11-27 2:28:46]
# 1
if(strurl.endsWith("/")){ strurl = strurl.substring(0, strurl.lastIndexOf("/") );}
gimbal2a at 2007-7-12 2:41:20 > top of Java-index,Java Essentials,New To Java...