Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Follow us on Facebook Follow us on Twitter Linked In Flickr Watch us on YouTube Google+
Results 1 to 2 of 2
  1. #1
    Junior Member sunmaz_1234567's Avatar
    Join Date
    Nov 2010
    Posts
    1
    Downloads
    0
    Uploads
    0

    In Java, subString complains of having a negative index... yet neither the start nor

    end are negative. help!? this.proteinSequence = sDNA.substring(startAt, endAt); <---- The line of code causing the Exception.

    proteinSequence is a String.
    sDNA is a String of length > 16 000 characters.
    In this example, startAt = 3306 and endAt = 3192.
    When run I get the following bizarre error:

    "Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -114"


    Any help would be greatly appreciated!
    What other code could you need? My issue is that both the indicies are in bounds....that is why I am confused.

  2. #2
    Member Vomit's Avatar
    Join Date
    Jul 2010
    Posts
    49
    Downloads
    0
    Uploads
    0
    How can we tell when you've given us jack squat worth of code? Out of bounds means you used a value that does not exist in the string. You either went over or under the index.


Similar Threads

  1. Replies: 0
    Last Post: 01-10-2011, 04:16 AM
  2. why do stock index futures (SIF) have an index multiplier?
    By weeds_xy in forum Predictions and Prophecies
    Replies: 0
    Last Post: 03-09-2009, 01:10 AM
  3. Replies: 2
    Last Post: 12-23-2008, 07:09 PM
  4. Replies: 0
    Last Post: 11-15-2008, 03:43 AM
  5. What is the best way to deal with a friend who is very negative and complains a lot?
    By Praying for baby #1 in forum Rant-Whine-Complain-Vent
    Replies: 1
    Last Post: 05-12-2008, 08:49 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -4. The time now is 06:30 AM.
Powered by vBulletin® Version 4.2.5
Copyright © 2024 vBulletin Solutions Inc. All rights reserved.