如何从一行字符串中获取字符串?

| 我有以下字符串:
\"hw_core_detectionhook::Iocard const*\"
我只需要获得第一部分,即在空格之前出现的所有文本,即我只需要
\"hw_core_detectionhook::Iocard\"
部分。
已邀请:
s.substr(0,s.find_first_of(\" \"));
std::stringstream ss;

ss << \"hw_core_detectionhook::Iocard const*\";

std::string s;

ss >> s;

std::cout << s;
输出:
hw_core_detectionhook::Iocard
在线观看完整的演示:http://www.ideone.com/w9l1C

要回复问题请先登录注册