Solved

Replace All

Posted on 2004-10-15
4
1,108 Views
Last Modified: 2008-01-09
I am using the replaceAll function.
Seems like when the string contains $, it will throw me an error.
Is that  a limitation? If yes, are there any other characters that cannot be in the string.

strTemp = strContent.replaceAll("#a#", "$10");
0
Comment
Question by:yan_er04
4 Comments
 

Author Comment

by:yan_er04
ID: 12321587
I got the answer.
Seems like backslashes (\) and dollar signs ($) cannot be in the string.

Please reply if there are more special characters.
0
 
LVL 35

Accepted Solution

by:
TimYates earned 100 total points
ID: 12322119
strTemp = strContent.replaceAll( "\\#a\\#", "\\$10");

Should work...  You have to escape symbols...  And I think $ means "group" in the regex package which replace all uses...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bean mapper frameworks 5 63
Limiting the number of characters a user can type in a text field 6 61
maven project jars 7 55
countXY challenge 28 160
IT certifications are a concrete representation of continual learning on the part of the candidate.  Continual learning is necessary for the long term success of an IT professional, but are IT certifications the right path for you?
The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question