Replace substring with charAt to check for embedded objects.