C++ string

string 转 c风格字符串(string my_string):

  • my_string.c_str()

streamstring 一种iostream 格式化流 混合类型

int levelNum = /* ... */;
stringstream messageText;
messageText << "Level " << levelNum << " is out of bounds.";
MessageBoxAlert(messageText.str());

substr 字符串截取

  • my_string.substr(i,j) 截取i位后j个字符
  • my_string.substr(i) 截取i位到末尾的字符
posted @ 2020-03-13 09:00  youqia  阅读(98)  评论(0编辑  收藏  举报