Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String handling

 
Priyadharshini Nagarajan
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

String x = new String("hai welcome , ");

tell me how i can remove that last comma and space..
 
Vijayendra V Rao
Ranch Hand
Posts: 195
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


A better way would be:

 
Priyadharshini Nagarajan
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

i have to delete the last comma and space
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should really be in Java/Basic but, since your here....

Assuming you know that it will consistently be a ", ".


If there are other variations that will need to be handled, look at the String's lastInstanceOf and trim methods, or better, if you can use jsdk1.4 or higher, the regexp tools that now ship with Java.
[ January 21, 2005: Message edited by: Ben Souther ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic