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

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:

主站蜘蛛池模板: 梁河县| 温宿县| 宽甸| 临颍县| 灌阳县| 当雄县| 五台县| 依安县| 青浦区| 余姚市| 沂南县| 沾化县| 将乐县| 乐陵市| 灵山县| 壤塘县| 社旗县| 金溪县| 四平市| 宁晋县| 宁国市| 无棣县| 武平县| 永春县| 青冈县| 莆田市| 长治市| 西宁市| 商水县| 交口县| 北票市| 噶尔县| 桐乡市| 晋宁县| 夏河县| 高淳县| 罗定市| 英山县| 亚东县| 东宁县| 陆河县|