By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,132 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

how to eliminate dot (".") in property money

P: 77
hello all, i have this situation, i have this script below

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. var money="45.000.000";
  4. document.write(str.replace(/./, ""));
  5.  
  6. </script> 
You see, i want to eliminate the element "." in variable money with replace reference, but it didn't work..

any idea/ solution?
May 1 '09 #1

✓ answered by acoder

The dot is a special character, so you have to escape it:
Expand|Select|Wrap|Line Numbers
  1. /\./

Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
The dot is a special character, so you have to escape it:
Expand|Select|Wrap|Line Numbers
  1. /\./
May 1 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.