RnD*_*RnD 8 c++ string swap
有没有办法在字符串中交换字符位置?例如,如果我有"03/02"我需要"02/03".任何帮助表示赞赏!
"03/02"
"02/03"
Ker*_* SB 25
当然:
#include <string> #include <algorithm> std::string s = "03/02"; std::swap(s[1], s[4]);
归档时间:
13 年,11 月 前
查看次数:
38811 次
最近记录:
7 年,6 月 前