🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
1、long_text.count('the'),查看在long_text字符串中,有多少个the ``` long_text = "the is the is" print long_text.count('the') ``` 2、long_text.find('the'),查看long_text字符串中第一个the出现的位置 ``` long_text = 'aaa the is the is' print long_text.find('the') ``` 3、replace(),文本替换![] ``` long_text = 'this is ugly' print long_text.replace('ugly','meh') ```