[Javascript] removing periods

Costea Dan costea.dan at ssi-schaefer.ro
Thu Mar 11 06:04:54 CST 2004


here is what you need:

var sText = "1.00,2.00,3.00,4.00,1.01,1.10";
var regReplace = /\./g;
alert (sText);
alert (sText.replace (regReplace, ""));


----- Original Message ----- 
From: "Paul McGuire" <pmcguire at cguk.co.uk>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Thursday, March 11, 2004 1:19 PM
Subject: [Javascript] removing periods


> I have a string of values
>
> E.G
>
> 1.00,2.00,3.00,4.00,1.01,1.10
>
> I build this string up in a loop that reads textboxes in a form. The
> variable This string is then stored in is called TOTAL
>
> E.G
>
> TOTAL = "1.00,2.00,3.00,4.00,1.01,1.10"
>
> I need to be able to remove all the . from the variable TOTAL so the
string
> is.
>
> 100,200,300,400,101,110
>
> I expect a regular expression or TOTAL.replace is needed but I cant seem
to
> get anything to work.
>
> Thanks
>
> Paul McGuire
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list