• Post Reply Bookmark Topic Watch Topic
  • New Topic

How handle this error  RSS feed

 
shinu pillai
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iam reading file line by line by buffered reader and writer in reading follwing lines
<edm:OrderItem><edm:OrderItemReconciliation orderREF="1036578"></edm:OrderItem>
for the above line i can handle this way...
end5Pos = line.indexOf("\">",start5Pos);
but below line how i hndle...
<edm:OrderItem><edm:OrderItemReconciliation orderREF="1036578"/></edm:OrderItem>
if i hndle above way stringindex out of bound because end 5Pos=-1,canu please help me
 
Amit Batra
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Youre asking this in the wrong forum
2. When you ask questions, please try to ask clearly and give more information. I cant understand at all what you are asking
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If end5Pos is -1, it means that the string you were looking for was not found. You will have to handle this case separately in your source code.
 
shinu pillai
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please tell me what condition ineed to wrien on if condition.Anyway ineedto get output as 1036578
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Shinu, I can't help you further, because I don't know in what context you are using this code (you didn't tell us). What is the purpose of the program you are writing, and where do you get stuck? Explain exactly what the program is supposed to do, what it actually does and how that differs from what you expect.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!