Strip function prototypes
declaration : S is a string, RM is a sequence of characters to be deleted
S.strip (RM) Remove the characters from the beginning and end of the s string in the RM delete sequence
S.lstrip (RM) Delete the character in the S string at the beginning of the RM delete sequence
S.rstrip (RM) Removes the character from the end of the S string that is located in the RM delete sequence
Note :
1. When RM is empty, the default is to remove the whitespace characters (including ' \ n ', ' \ R ', ' \ t ', ')
For example:
2. The RM delete sequence here is deleted as long as the character on the edge (beginning or end) is within the delete sequence.
For example:
Split function prototype
First, about the split and join methods
1 is processed only for strings. Split: Split string, join connection string
2.string.join (Sep): Combines all elements of Sep (string representations) into a new string, using string as a separator
3.string.split (str= ", Num=string.count (str)): delimited by str, the character slices a string, and if NUM has a specified value, only the NUM substring is delimited.
4. Os.path.splie ()/os.path.join () on the Import OS module seems to be a different processing mechanism, but functionally identical.
Reference:
Http://www.cnblogs.com/beginman/archive/2013/03/21/2972857.html
http://wangwei007.blog.51cto.com/68019/1100587
Http://www.runoob.com/python/att-string-split.html
Python--strip,split,join