Do string slicing in C++