Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes String replacement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "String replacement" Watch "String replacement" New topic
Author

String replacement

Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
How do we prepend all expressions in a specified list,with an excape character,in the shortest possible way.
Suppose ,we have a string - "Are+we @in /for a ? surprise"
We need an output string which looks like "Are\+we \@in \/for a \? surprise"
What is the smartest way of achieving this?
Laxmikant Ruikar
Greenhorn

Joined: Nov 29, 2005
Posts: 23
Use regular expression pattern to replace string...


LDR.
Piet Verdriet
Ranch Hand

Joined: Feb 25, 2006
Posts: 266
Here's a way:

 
wood burning stoves
 
subject: String replacement
 
Similar Threads
Difference between String[] and String...?
jquery, difference between "DOM Insertion, Inside" and "DOM Insertion, outside"?
Qs about literals
WA #1.....word association
Deployments Misbehaving