Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

removing commas from the end of the string

Posted on 2006-07-06
2
Medium Priority
?
318 Views
Last Modified: 2010-03-31
i am bit confuded that how could i remove commas appearing in random numbers as post fix of the String. like

I have strings like

abc,
abc,,,
yyyyy,,
rrrr,,,,,,,,,,,,,,,

above strings are being generated after a concatanation process...some how lots of commas appearing at the end..not a fix number though. Now i want to remove these so that i have strings like

abc
abc
yyyyy
rrrr
0
Comment
Question by:jaipur07
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 17051063
s = s.replaceAll(",+$", "");
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17051174
:-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question