给出如下字符串:
sdfsd34
sdfdsf1
Run Code Online (Sandbox Code Playgroud)
我想提取:34,1 使用c ++(STL但没有提升),c.
谢谢
Kon*_*lph 26
你正在寻找这个功能string.find_last_not_of:
string str = "sdfsd34";
size_t last_index = str.find_last_not_of("0123456789");
string result = str.substr(last_index + 1);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8360 次 |
| 最近记录: |