官术网_书友最值得收藏!

The find(), index(), upper(), lower(), len(), and count() methods

The find() function is used to search for a character or string within our target string. This function returns the first index of the string if a match is found. It returns -1 if it does not find the match:

The index() method is identical to the find() method. It returns the first index of the string if it finds the match and raises an exception if it does not find a match:

The upper() method is used to transform the input string to upper case letters and the lower() method is used to transform a given string to lowercase letters:

The len() method returns the length of the given string:

The count() method returns the number of occurrences of any character or string that we wish to count within the target string:

主站蜘蛛池模板: 浦县| 博白县| 太康县| 肇东市| 霍邱县| 汉源县| 和平县| 仙居县| 贵德县| 宁武县| 巴林左旗| 青铜峡市| 德格县| 鄱阳县| 东丰县| 永春县| 宜春市| 连城县| 乌审旗| 天全县| 乐都县| 光山县| 安丘市| 长沙市| 聂荣县| 花莲市| 忻城县| 华池县| 仁布县| 金阳县| 永兴县| 乳山市| 藁城市| 双辽市| 荔浦县| 洮南市| 白银市| 平潭县| 甘谷县| 墨竹工卡县| 得荣县|