There last 2 days I am 100% brain dead and cant find where the error is... Can anyone give me a tip >>

```
for(String inputString : word)
{
    StringBuilder sb = new StringBuilder(inputString);

    if(inputString.charAt(inputString.length()-1) == ']')
    {
        sb.deleteCharAt(inputString.length());
    }
    else if(inputString.charAt(0) == '[')
    {
       sb.deleteCharAt(0);
    }
    breaker.add(sb.toString());
}

```

It was suppose to be a simple function to remove the [ ] characters from a string but everytime I run it I get 

```
Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: 4

```

But only on the third or fourth pass never the first or second.
Confused.