Don't parse input strings in a way they have to be copied or modified, use begin/end indices instead.