?
Solved

removing commas from the end of the string

Posted on 2006-07-06
2
Medium Priority
?
320 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
  • 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

864 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