File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

StringIndexOutOfBoundsException

 
Frederik Bolding
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there.

I am having a problem with my code..
It is force closing when i run it.
With the error: StringIndexOutOfBoundsException

My code:



- Frede1012
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't say in which line this happens, so I'm guessing either line 42 or 43. What is the value of "n"? If it's -1 or equal to the length of "result" you're in trouble.
 
Frederik Bolding
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:You didn't say in which line this happens, so I'm guessing either line 42 or 43. What is the value of "n"? If it's -1 or equal to the length of "result" you're in trouble.


I dont really know, i got help on an irc and did this.
But it is still not working.
Im trying to get the first two lines of the memoryinfo thingy.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm just noticing that lines 41 to 45 are not part of any method; it looks like they need to go between lines 12 and 13.
 
Frederik Bolding
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay that fixes the error.
But it still shows the whole meminfo instead of only output string?
 
Frederik Bolding
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind!
Thanks for the help!

/solved
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic