Solved

Replace All

Posted on 2004-10-15
4
1,111 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
Today’s effective marketing is about coming down to the customers’ level and engaging in a whole new way. A text message is one of the most effective and influential ways that you can engage your customers. Here are eight ways that you can utilize t…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

695 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