C++ 处理中文符号
英文符号替换为英文逗号
代码如下 | 复制代码 |
processPunctuation(string& tag) { std::set punctuation_set.insert(' '); punctuation_set.insert('t'); punctuation_set.insert('');
for(inti=0; i< tag.size(); i++) { if(punctuation_set.find(tag[i]) != punctuation_set.end()) { tag[i] =',' } } return; } |
中文逗号替换为英文逗号
代码如下 | 复制代码 |
processChinesePunctuation(string& tag) { string u8comma = u8","; for(inti = 0; i < tag.size() - u8comma.size() + 1; i++) { boolfind =true; // 查找空格依赖于 UTF-8 的特性 for(intj = 0; j < u8comma.size(); j++) { if(tag[i + j] != u8comma[j]) { find =false; break; } }
if(find) { // 替换为 , tag[i] =',' auto it = tag.begin(); it += i + 1; for(intj = 1; j < u8comma.size(); j++) it = tag.erase(it); } } return; } |
恋爱进行时九游版
恋爱进行时九游版是一款以模拟恋爱玩法为核心的角色扮演手游,精
皇室对决fr(Null’s Royale)
皇室对决fr,即皇室战争的私服变态版本,在该版本中玩家能够拥
养了个猫联机版游戏
养了个猫小游戏一个猫咪主题的模拟经营类型的手游,在游戏中我那
模拟山羊收获日小米版
模拟山羊收获日小米版是一个极其魔性的手机游戏,在游戏中玩家将
女配逆袭之素衣
女配逆袭之素衣是一款恋爱养成冒险的一款游戏,可以角色扮演,在