📌  相关文章
📜  如何在某个位置之后创建子字符串 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:47.570000             🧑  作者: Mango

代码示例1
// CPP program to illustrate substr()
#include 
#include 
using namespace std;
 
int main()
{
    // Take any string
    string s = "dog:cat";
 
    // Find position of ':' using find()
    int pos = s.find(":");
 
    // Copy substring after pos
    string sub = s.substr(pos + 1);
 
    // prints the result
    cout << "String is: " << sub;
 
    return 0;
}