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

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:

主站蜘蛛池模板: 上蔡县| 邵阳县| 祁东县| 乐昌市| 江城| 泸溪县| 佳木斯市| 阿坝县| 新乐市| 河南省| 从化市| 留坝县| 扎囊县| 大关县| 临西县| 庐江县| 鹿邑县| 长兴县| 铜川市| 大余县| 永和县| 福泉市| 上林县| 柞水县| 浠水县| 甘南县| 尖扎县| 黄山市| 红河县| 大厂| 高碑店市| 枝江市| 玛曲县| 绍兴县| 扶沟县| 上蔡县| 莱芜市| 都匀市| 叶城县| 永善县| 祁东县|