You can use indexOf to find out the first position of your character. If there is only two of the characters you can use lastIndexOf to find out the second position of your character. If there are many then you can find out the first one, then substring from the first one till the end and do another search for the first one using indexOf again. Then add indexOf from the first search and indexOf from the second and you have the second position of your character in the full string. Finally use get (substring) to chop from the first character to the second character position.