I need to search for a particular word that the user enters in a textfield and append either single or double quotes to it. e.g. mySearchField = StringUtils.replace(mySearchField, "xyz", "here I want to replace xyz with 'xyz' or "xyz" ); Is there a way to accomplish this? Thanks!
Joined: Apr 07, 2007
You might want to consider using the replace method in the String class. So, something like:
If you want to use single quotes, just put them in there like this:
If you want to use double quotes, use the backslash as the escape character:
Hope this helps, Jeff