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

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:

主站蜘蛛池模板: 沽源县| 格尔木市| 衡水市| 南康市| 开封市| 揭西县| 广昌县| 罗山县| 高阳县| 屯昌县| 抚州市| 靖远县| 洪湖市| 裕民县| 洛阳市| 淮阳县| 南召县| 武定县| 鲜城| 通河县| 北海市| 大足县| 枣庄市| 绵阳市| 广汉市| 荣昌县| 项城市| 玉环县| 泰和县| 潢川县| 无为县| 额济纳旗| 浦东新区| 通化市| 赤城县| 威信县| 云安县| 荥经县| 磐安县| 黔东| 资阳市|