企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
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') ```