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

Popular Categories





How to remove comma in String array ?

+2 votes
483 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 109 views
+2 votes
1 answer 141 views
+6 votes
2 answers 2,107 views
+2 votes
1 answer 94 views
0 votes
0 answers 57 views
+3 votes
1 answer 624 views
+2 votes
3 answers 280 views
asked in Programming by jatin Expert (3,823 points)
+1 vote
1 answer 764 views
+2 votes
2 answers 788 views
+5 votes
1 answer 106 views
asked in Programming by jatin Expert (3,823 points)

Not a Member yet?

Ask to Folks Login

My Account
613 Folks are online
68 members and 545 guest online
Your feedback is highly appreciated