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

Popular Categories





How to remove comma in String array ?

+2 votes
765 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 148 views
+2 votes
1 answer 174 views
+6 votes
2 answers 2,821 views
+2 votes
1 answer 124 views
0 votes
0 answers 75 views
+3 votes
1 answer 783 views
+2 votes
3 answers 306 views
asked in Programming by jatin Expert (3,823 points)
+1 vote
1 answer 885 views
+2 votes
2 answers 802 views
+5 votes
1 answer 144 views
asked in Programming by jatin Expert (3,823 points)

Not a Member yet?

Ask to Folks Login

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