返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<string>
  4. using namespace std;

  5. int main()
  6. {
  7.     string a1="0123456789";
  8.     cout<<"原字串:"<<a1<<endl;
  9.     cout<<a1.substr(7)<<endl;
  10.     cout<<a1.substr(2)<<endl;
  11.     cout<<a1.substr(4,4)<<endl;
  12.     cout<<a1.substr(1,8)<<endl;
  13. }
複製代碼

TOP

返回列表