- Hands-On Penetration Testing with Python
- Furqan Khan
- 102字
- 2021-07-02 14:13:48
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:

推薦閱讀
- scikit-learn Cookbook
- 微服務與事件驅動架構
- Game Programming Using Qt Beginner's Guide
- CouchDB and PHP Web Development Beginner’s Guide
- Learning Python Design Patterns
- Scala編程實戰(原書第2版)
- 蘋果的產品設計之道:創建優秀產品、服務和用戶體驗的七個原則
- Python算法詳解
- Machine Learning With Go
- Java從入門到精通(視頻實戰版)
- C/C++代碼調試的藝術
- Android 5從入門到精通
- Practical Time Series Analysis
- 計算機輔助設計與繪圖技術(AutoCAD 2014教程)(第三版)
- 面向對象程序設計教程(C#版)