Hi, I am using getParameter() to grab a hidden field on a jsp. My problem is that the string coming back is separated by commas including an extra one on the end (ex. value1,value2,value3,) this is playing havoc with my substring. It seems to think there is another value after the last comma and is bringing me back a blank. So I guess my question is what is the best way to get rid of/ignore this last comma? Any suggestions would be appreciated.
If you think a reusable utility will be worth while over your lifetime, you might implement something from the REXX language: strip( string, whichend, what ). To strip trailing commas you could say s = Utility.strip(s, "T", ","). I used to use this to remove leading zeros all the time, but can't say I've used my Java implementation much.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi