Different string manipulation problems