python split

来源:互联网 发布:手机编程软件c 编辑:程序博客网 时间:2024/06/05 00:14

1. split 常规用法

help(str.split)split(...)    S.split([sep [,maxsplit]]) -> list of strings        Return a list of the words in the string S, using sep as the    delimiter string.  If maxsplit is given, at most maxsplit    splits are done. If sep is not specified or is None, any    whitespace string is a separator.

  •        str.split('sep') 返回的list 支持index 是负值


2. split 的正则表达式


0 0
原创粉丝点击