Thanks to all who replied. For some reasons, the substr(int, int) function was giving me some error. I ended up using myString.substring(int, int)