Hey there! any question in your mind? Ask It Now!.

Popular Categories





How to remove comma in String array ?

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

 

want to remove comma in the numeric values

1 Answer

+1 vote
answered by Pooja

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 !

Related Questions

–1 vote
0 answers 108 views
+2 votes
1 answer 138 views
+6 votes
2 answers 2,016 views
+2 votes
1 answer 93 views
0 votes
0 answers 55 views
+3 votes
1 answer 597 views
+2 votes
3 answers 277 views
+5 votes
1 answer 105 views

Not a Member yet?

Ask to Folks Login

My Account
152 Folks are online
0 members and 152 guest online
Your feedback is highly appreciated