标签: c++ string compare
我有一个字符串,它是从ini文件中读取的,带有在运行时填充的变量。因此,如果模板字符串看起来像[name] has [his/her] ball at [name01]'s place,则处理后的字符串看起来像Alice has her ball at Bob's place。
[name] has [his/her] ball at [name01]'s place
Alice has her ball at Bob's place
但是我不确定如何检查处理后的字符串是否与模板格式匹配。
起初,我想过将字符串分成令牌,然后检查是否至少有60%的字符串匹配,但是必须有更好的方法?