Careful with str.substring() and str.charAt()