Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic editing with strings

 
Sebastian Green
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Im confused right now. Im having problems to edeting strings. I have a string "adam;john;doris;william;". Then I want to remove "doris;" from the string. I havent found a good way to solve this, not with Strings and not with Arrays... Perhaps the lack of sleep is making my dizzy...
 
necati sekkeli
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to use StringTokenizer class. Did you tried? This is the simplest solution.
 
arnel nicolas
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StringTokenizer is not available in MIDP 1.0 neither MIDP 2.0. I guess
you have to do it on your own way.

arnel
 
necati sekkeli
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes that's true stringtokenizer is not available :roll:
 
Sebastian Green
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But its has to be a simple sollution to this problem? I cant be the first guy to facing it?
 
Sam Hendley
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
damn I wish this site would upgrade to some better forum software and display the thread on the post page somewhere. Anyways the basic problem you are having is that String objects are immutable; which means that you cannot alter them in place like you could in C. What you need to do is make a new a string by concatating together the two pieces around the part your removing.


Something like that anyways
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic