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

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:

主站蜘蛛池模板: 凤城市| 蒙城县| 疏勒县| 达日县| 东山县| 达州市| 贵阳市| 巴林左旗| 永兴县| 富源县| 宣化县| 慈利县| 师宗县| 金川县| 华池县| 锡林浩特市| 库伦旗| 黎川县| 乐平市| 卢氏县| 栖霞市| 墨脱县| 望城县| 张家港市| 合江县| 章丘市| 蚌埠市| 天祝| 万全县| 清原| 馆陶县| 玉屏| 拉孜县| 宜都市| 扎兰屯市| 双牌县| 丰顺县| 舒兰市| 岑溪市| 台北县| 东阳市|