tomboman
asked on
search for coded URL string "%06"
I've got a decoded URL string, and in that string there is an not-displayable-character encoded representing "%06",
question is: How do search for that not displayable charcter where I want to use it as a delimiter in methods like StringTokenizer(String str, String delim)?
Thanks.
question is: How do search for that not displayable charcter where I want to use it as a delimiter in methods like StringTokenizer(String str, String delim)?
Thanks.
you can decode it first and then it will take a single char.
I don't think that you can use
String.indexOf() with such a character. Instead of this I suggest using
StringTokenizer(String str, String delim = "%06")
with the encoded string and after that - decoding the returned tokens
String.indexOf() with such a character. Instead of this I suggest using
StringTokenizer(String str, String delim = "%06")
with the encoded string and after that - decoding the returned tokens
The following should work:
String s = "hello%06world";
java.util.StringTokenizer st = new java.util.StringTokenizer( s, "%06");
while (st.hasMoreTokens())
{
System.out.println(st.next Token());
}
and the output should be:
hello
world
Hope it helps.
String s = "hello%06world";
java.util.StringTokenizer st = new java.util.StringTokenizer(
while (st.hasMoreTokens())
{
System.out.println(st.next
}
and the output should be:
hello
world
Hope it helps.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Very detailed answer jim, thanks.