Iterate through the string manually