Forums Register Login

Replacing strings like %3C with any functions in java

+Pie Number of slices to send: Send
Is there any function in JAva that i can use
to replace
%3C with <
%/*%3C with <
%3E with >
%2F with /
%0D%0A with
+Pie Number of slices to send: Send
nope but you can always build your own method for that purpose.
Have a look at the class Matcher in java.util.regex (J2SDK 1.4b2) which contains a method named replaceAll(). You could invoke replaceAll on the Pattern containing those weird character sequences you would like to replace.
You have to represent the character sequences you would like to replace with regular expression (the API contains a good doc about how to do it)...
HIH
+Pie Number of slices to send: Send
It seems as you wanted to url-decode Strings....I would have a look at java.net.URLDecoder and java.net.URLEncoder.
Sorry for the question but... what has your question to do with Programmer Certification Study ?
Hope it helps,
Horaci Macias
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3330 times.
Similar Threads
SOAPAction header problem...Urgent
sendRedirect fails to post data along with url if the data is too large
save a xml file using java
Replacing Strings with characters, any functions in java that can do this job
I need the URL unicode representation of <> angle brackets?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:24:49.