int, float, char, bool, main, void main, int main, cout, cin
如果在字符串上找到它,我想删除(技术上替换)单词""
(比如删除它)。
所以如果我有ff:
str = "void main(){ couts<<"wrong"; cout<<"right"; }"
更换后应该是:
str = "(){ (); couts<<"wrong"; <<"right"; }"
单词 int、float、char、bool、main... 等存储在数组中
kWord[0] = /int/
kWord[1] = /float/
kWord[2] = /char/
kWord[3] = /bool/
kWord[4] = /main/
kWord[5] = /void\s+main/
kWord[6] = /int\s+main/
kWord[7] = /cout/
kWord[8] = /cin/
这与我之前的问题有关如何以最快的方式删除部分字符串,但这次单词在数组中