• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get substrings between sentinel characters?  RSS feed

 
Jesse Crockett
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need an integer value for the first occurrence of the character '#'

then I need to take a substring from that occurrence to the next '#'

and so forth. Here is what I'm trying to do in code:


[ February 07, 2006: Message edited by: Jesse Crockett ]
 
Joe Ess
Bartender
Posts: 9439
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this line:

I am assuming that "Roget" should be "scanRoget"
String.substring() takes two integer arguments for positions to begin and end the substring. Why are you passing it a character (which is what scanRoget.charAt(poundLocation) would return)?
[ February 07, 2006: Message edited by: Joe Ess ]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!