How to remove comma before an String?
How to remove comma before an String?
myString = bhanu,balaji,guddanti
i wnt my output will be
outString = bhanu,balaji guddanti(removing last comma before an string)
i'm using jdk1.4..
i'm new to java..please suggest me an solution
Appreciate a lot in advance...
Thanks
Bhanu
Re: How to remove comma before an String?
Re: How to remove comma before an String?
There are several different ways you can do this.
I've read your cross post and people have suggested reading the String API. Have you done this?
You could use the Split method and use a comma as a delimiter. Then reconstruct the String...
Re: How to remove comma before an String?
Quote:
Originally Posted by
JavaPF
... You could use the Split method and use a comma as a delimiter. Then reconstruct the String...
The OP probably wants to find the last index of the comma... ;)
Re: How to remove comma before an String?
Quote:
Originally Posted by
dlorde
The OP probably wants someone else to do the work
There, fixed!