Finding the position of backslash character in a string
843835May 27 2003 — edited Feb 28 2008Hi everyone,
I have a string which represents a file path.
Example:
String str = "C:\test\test.jsp";
I need to find the position of back-slash("\") characters in this string. Can anyone help me with this.
I tried doing by following methods:
(1) str.indexOf("\")
(2) Using ASCII Value of backslash and comparing that value to integer casted value of each character in string.
The first method returns error and second one doesnt returns anything.
Thanks.