Microsoft interview question

They asked me two questions about string manipulation.