469,289 Members | 2,265 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,289 developers. It's quick & easy.

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

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. /\./

1 1206
acoder
16,027 Expert Mod 8TB
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.

Similar topics

11 posts views Thread by Der Andere | last post: by
5 posts views Thread by Mark Hannon | last post: by
4 posts views Thread by Bill Borg | last post: by
23 posts views Thread by Abhi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.