- Hands-On Penetration Testing with Python
- Furqan Khan
- 130字
- 2021-07-02 14:13:49
The split() method
The split method, as the name suggests, is used to split the input string over a particular delimiter and return a list that contains the words that have been split. We will be looking at lists in more detail shortly. For now, let's take a look at the following example, where we have the name, the age, and the salary of an employee in a string separated by commas. If we wish to obtain this information separately, we can perform a split over ,. The split function takes the first argument as the delimiter on which the split operation is to be performed:

By default, the split operation is performed over a space, that is, if a delimiter is not specified. This can be seen as follows:

推薦閱讀
- Designing Machine Learning Systems with Python
- FuelPHP Application Development Blueprints
- 高手是如何做產(chǎn)品設(shè)計的(全2冊)
- Arduino by Example
- MongoDB for Java Developers
- Java軟件開發(fā)基礎(chǔ)
- Java EE 7 Development with NetBeans 8
- 嚴(yán)密系統(tǒng)設(shè)計:方法、趨勢與挑戰(zhàn)
- bbPress Complete
- R語言與網(wǎng)絡(luò)輿情處理
- Protocol-Oriented Programming with Swift
- Java面向?qū)ο蟪绦蛟O(shè)計
- Clojure for Java Developers
- ASP.NET Web API Security Essentials
- 面向?qū)ο蟪绦蛟O(shè)計及C++(第3版)