Rotate a string in c++?

前端 未结 9 612
梦毁少年i
梦毁少年i 2020-12-29 00:57

I\'m looking for a way to rotate a string in c++. I spend all of my time in python, so my c++ is very rusty.

Here is what I want it to do: if I have a strin

9条回答
  •  心在旅途
    2020-12-29 01:31

    Is doing it in place a requirement?

    If not, you're probably best off taking a substring of all but the first char, and then appending the first char to the end.

提交回复
热议问题