String help

How can I read a string starting at the second letter until the end of the string? I tried something like stringname[1,stringname.length()] but that didn't work.

string myString = stringname.substr(1);
Last edited on
As a follow-up see http://www.cplusplus.com/reference/string/string/substr/.

Boxbird's answer is correct. That will initialize myString to the contents of stringname starting from the second letter.
Topic archived. No new replies allowed.