Please do not use index based substring routines. Instead use StringUtils.substringBetween() or any other of the StringUtils routines. Basically you should avoid calling _any_ method at a String object, because for each of them there is a better or more fault tolerant version available at StringUtils.