Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

STRING MANAGEMENT

 
Gabriel Collet
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone.

I have a string which is made of several different strings separated by a "+" sign. Now I want to divide it into different substrings, each one containing the information between two "+" signs. I�ve tried using lasIndexOf command, by I keep getting the same error when building the application (canno resolve symbol). DOES ANYONE KNOW THE TRICK OR HAS A SAMPLE I CAN USE?!!!

PLEASE, GIVE ME A HAND.

Thanks a lot.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"JG GA"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need a "/" or is it a "\" before the plus sign to , now what is that word, to to escape it. The "/" is an escape character for characters that might have other meanings to the compiler, like the plus sign.

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or use a different seperator. Use a comma instead in the String instead of putting "+" in the String.

Mark
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!