You will get that error if you're using the charAt() method and other methods. According to java.sun.com's API documentation you get that error when:
public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException Thrown by the charAt method in class String and by other String methods to indicate that an index is either negative or greater than or equal to the size of the string.
The above code will generate the StringIndexOutOfBounds exception because there isn't 100 characters in string test. Jax