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
Solved

VERY VERY URGENT, how to take out ','

Posted on 2003-12-11
2
186 Views
Last Modified: 2010-04-01
hi,
  Pls help, i have something like this:


    theskillss.append(rs3.getString("skill"));
    if(theskillss.length()>1)
        theskillss.append(',');

and when this comes out,it is like

Teacher,Doctor,Dentist,

How to do , from the last string, take out ','
so it would be like this :

Teacher,Doctor,Dentist
0
Comment
Question by:Jasbir21
2 Comments
 
LVL 1

Assisted Solution

by:gwang77
gwang77 earned 25 total points
ID: 9919055
if(theskillss.length()>1)
{
  if(!rs3.isLast())
   {
            theskillss.append(',');
   }
}
0
 
LVL 2

Accepted Solution

by:
koeniz earned 25 total points
ID: 9919285
or after the loop:

if (theskillss.lenght() > 0){
  theskills.setLength(theskills.length-1);
}

that way you can kill both tests inside the loop
   (theskillss.lenght()>1)
   and (!rs3.isLast())

this is more efficient

hth,

Koen Weyn
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
hashcode is calculated on the basis of value object 2 118
issue with pdf generation 2 93
reflection example 3 110
Books that can get me started on JAVA 2 104
Are client relationship the only driver of a successful MSP? While important, client relationships are only one component. Learn how else MSPs can broaden their horizon and differentiate themselves.
IT certifications are a concrete representation of continual learning on the part of the candidate.  Continual learning is necessary for the long term success of an IT professional, but are IT certifications the right path for you?
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

766 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