• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Basic editing with strings  RSS feed

 
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...
 
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.
 
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?
 
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!