+2 votes
1.8k views
in Programming by
String s=["999,999.00","123,25.00","452,452,123.00"]

 

want to remove comma in the numeric values

1 Answer

+1 vote
by

String A[] =["999,999.00","123,25.00","452,452,123.00"]

 

         for(int i=0;i<=A.length;i++){

        //     There are two ways to do this first is replace all char except numeric values or just replace comma.
       //      First replace comma
             
              System.out.println(str.replaceAll(",", ""));
             
        //     Sec replace all chars except numeric values
             
             System.out.println(str.replaceAll("[^\\d.]", ""));
             
         }

 

I hope it helped !

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated