4. python's string Methods

One. Private methods:

1. Case: upper () and lower ()

2. Replace: replace ()

3. determine whether to digital: isdigit

4. Split string: split () /

5. Elimination last characters: Strip / rstrip / lstrip

6. hyphenation:. "_" Join (str)

7. formatting characters:. "{0}, {1}, {2}" format (str, str1, str2)

8. determine whether to "str" ​​at the beginning: startswith \ endswith

The coding: encode, gbk, encode ( "utf-8")

Guess you like

Origin www.cnblogs.com/jiaodajiage/p/12153846.html