• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How handle this error

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This is awkward. I've grown a second evil head. I'm going to need a machete and a tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic