wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Replacing strings like %3C with  any functions in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Replacing strings like %3C with  any functions in java" Watch "Replacing strings like %3C with  any functions in java" New topic
Author

Replacing strings like %3C with any functions in java

Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
Is there any function in JAva that i can use
to replace
%3C with <
%/*%3C with <
%3E with >
%2F with /
%0D%0A with


Bhasker Reddy
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
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


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Horaci Macias
Ranch Hand

Joined: Nov 08, 2001
Posts: 74
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Replacing strings like %3C with any functions in java
 
Similar Threads
sendRedirect fails to post data along with url if the data is too large
SOAPAction header problem...Urgent
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?