Solved

VERY VERY URGENT, how to take out ','

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Display the newly inserted values 3 72
maven webservice example issue 2 92
struts spring hibernate example 12 86
Java Script nested call 3 55
In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now