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

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:

主站蜘蛛池模板: 新乡县| 方正县| 大宁县| 万源市| 伊金霍洛旗| 禄丰县| 东城区| 博白县| 马尔康县| 乌兰浩特市| 剑阁县| 建水县| 泗阳县| 延庆县| 岚皋县| 滨海县| 达日县| 抚州市| 进贤县| 锡林浩特市| 广平县| 汽车| 龙州县| 桦南县| 广河县| 宝应县| 静乐县| 和平县| 张北县| 库伦旗| 寿光市| 长顺县| 同江市| 东莞市| 宜宾市| 霍邱县| 彩票| 亚东县| 房产| 双辽市| 泸定县|