?
Solved

removing commas from the end of the string

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

765 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