fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string text;
  7.  
  8. cout << "10: ";
  9. getline(cin, text);
  10.  
  11. cout << "From 2nd character: " << text.substr(1) << endl;
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5320KB
stdin
Enter a string: Hello
Length: 5
stdout
10: From 2nd character: nter a string: Hello