Oracle Community Directory
Oracle Community FAQ
Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
OTN Speaker Bureau
Please enter a title.
You can not post a blank message. Please type your message and try again.
This discussion is archived
on Oct 7, 2006 7:23 AM by 807607
Problem with indexOf() method
Oct 7, 2006 7:07 AM
I'm facing a problem while trying to format a string according to my criteria. I need to make a substring of the string giving the position using indexOf method. But the method isn't working well as I need. Given below is the code.......
temp1 = 3O|1||V06080000210R^A^04|^^^106^HBsAg^UNDILUTED|R||||||||||||||||||||F<CR><ETX>61<CR><LF>
I need to cut the string from ^'s 6th position+1 until 7th position-1.
I'm using indexOf method to draw the solution as given below....
int tst = temp1.indexOf('^',5);
int tst1 = temp1.indexOf('^',6);
Problem is it's not working. Can someone help me draw the solution?
This content has been marked as final.
Show 1 reply
Re: Problem with indexOf() method
Oct 7, 2006 7:23 AM
in response to
2nd arg is the index from which the given char should be looked for..
so tst and tst1 both will give the same index....
that is the pblm...