Solved

VERY VERY URGENT, how to take out ','

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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Running Java Servlet inside Eclipse Luna 6 158
Servlet Login session time and authentication using Filter 6 69
thymeleaf natural templating vs JSP 2 104
throw exception 21 44
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

803 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