Created
December 9, 2016 15:38
-
-
Save chendi0x7C00/8bcda9b683116c6f6275614f6ce52272 to your computer and use it in GitHub Desktop.
mastering string manipulation is extremely important
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding=UTF-8 | |
| import types | |
| # multi-line string | |
| def multi_line_str(): | |
| s = ('select * ' | |
| 'from atable ' | |
| 'where afiled="value"') | |
| print(s) | |
| # multi_line_str() | |
| a = "hi" | |
| assert isinstance(a, types.StringType) | |
| assert isinstance(a, basestring) | |
| b = u"hi" | |
| assert isinstance(b, types.StringTypes) | |
| assert isinstance(b, types.UnicodeType) | |
| assert isinstance(b, basestring) | |
| assert isinstance(b, unicode) | |
| # str方法分类: | |
| # 性质判定 | |
| # 查找替换 | |
| # 分切与连接 | |
| # 变形 | |
| # 填空与删减 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment