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

The strip(), lstrip(), and rstrip() methods

The strip method is actually used to strip off the white spaces from the input string. By default, the strip method will strip off the spaces from both the left and right sides of the string and will return a new string without spaces on both the leading and trailing sides, as shown in the following screenshot:

However, if we only wish to strip off the left spaces ,we can use the lstrip() method. Similarly, if we just wish to strip off the right spaces, we can use the rstrip() method. This is shown as follows:

主站蜘蛛池模板: 嘉黎县| 九龙城区| 合山市| 富民县| 金平| 平武县| 长岭县| 榕江县| 绥棱县| 垣曲县| 龙胜| 南华县| 嘉兴市| 双江| 唐河县| 金寨县| 长宁县| 高雄市| 通海县| 建湖县| 舒兰市| 宜兴市| 罗平县| 四川省| 博湖县| 会理县| 河津市| 富平县| 南充市| 龙岩市| 密山市| 开远市| 云阳县| 高青县| 无为县| 瓦房店市| 盈江县| 桂阳县| 齐齐哈尔市| 凭祥市| 神池县|