Solved

VERY VERY URGENT, how to take out ','

Posted on 2003-12-11
2
188 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
[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 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

Independent Software Vendors: 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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Changing a few Outlook Options can help keep you organized!
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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