substr有2种用法:
假设:string s = “012345”;

string sub1 = s.substr(2); //只有一个数字5表示从下标为5开始一直到结尾:sub1 = “2345”

string sub2 = s.substr(2, 2); //从下标为5开始截取长度为3位:sub2 = “23”

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-29
  • 2021-09-28
  • 2022-01-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2021-06-14
相关资源
相似解决方案