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

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:

主站蜘蛛池模板: 潢川县| 商洛市| 嫩江县| 游戏| 廊坊市| 昌宁县| 康定县| 封开县| 乌拉特中旗| 当雄县| 长春市| 晋城| 甘谷县| 玉门市| 壤塘县| 苍南县| 恩平市| 隆子县| 株洲县| 四川省| 海丰县| 赤水市| 鄂伦春自治旗| 达拉特旗| 新乡市| 江都市| 包头市| 囊谦县| 万州区| 仁怀市| 桑日县| 广河县| 沧州市| 喜德县| 新乡市| 孝感市| 永清县| 麻江县| 普安县| 扎兰屯市| 民勤县|