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

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:

主站蜘蛛池模板: 昆山市| 巧家县| 从化市| 木里| 巴彦县| 成安县| 瑞安市| 竹山县| 长岛县| 新郑市| 鹤岗市| 安新县| 佛坪县| 蕉岭县| 鹰潭市| 新泰市| 苏尼特左旗| 松滋市| 于田县| 建始县| 云阳县| 泰顺县| 田林县| 招远市| 洪雅县| 阜城县| 舞钢市| 永年县| 建湖县| 通海县| 环江| 太仓市| 宜州市| 彰化市| 大丰市| 类乌齐县| 宜兴市| 南岸区| 吉首市| 昂仁县| 同心县|