如果我有两种类型的字符串:
const char *str1 = "This is a string with \"quotes escaped at the end\"";
const char *str2 = "This is a \"string\" without quotes at the end";
testFn(str1);
testFn(str2);
int testFn(const char *str)
{
// test & return 1 if ends on no quote
// test & return 0 if ends on quote
return;
}
Run Code Online (Sandbox Code Playgroud)
我想测试字符串是否以引号"结束"
什么是测试这个的好方法?谢谢