我主要是从 C++ 库中寻找一个标准函数,它可以帮助我在字符串中搜索一个字符,然后从找到的字符开始打印出字符串的其余部分。我有以下情况:
#include <string>
using std::string;
int main()
{
string myFilePath = "SampleFolder/SampleFile";
// 1. Search inside the string for the '/' character.
// 2. Then print everything after that character till the end of the string.
// The Objective is: Print the file name. (i.e. SampleFile).
return 0;
}
在此先感谢您的帮助。如果您能帮我完成代码,我将不胜感激。