次のコードは、char 配列から句読点を正しく削除しました。
#include <cctype>
#include <iostream>
int main()
{
char line[] = "ts='TOK_STORE_ID'; one,one, two;four$three two";
for (char* c = line; *c; c++)
{
if (std::ispunct(*c))
{
*c = ' ';
}
}
std::cout << line << std::endl;
}
line
がタイプの場合、このコードはどのように見えるでしょうstd::string
か?