Python/String: Difference between revisions
< Python
Jump to navigation
Jump to search
| Line 15: | Line 15: | ||
| byte => str || <source lang="python">b'abc'.decode('utf-8)</source> | | byte => str || <source lang="python">b'abc'.decode('utf-8)</source> | ||
|- | |- | ||
| | | | | ||
| <source lang="python"> | |||
if s.startswith(): ... | |||
if s.endswith(): ... | |||
</source> | |||
|- | |- | ||
|} | |} | ||
Revision as of 16:47, 21 March 2018
Using statements
Using methods
| Sample | |
|---|---|
| byte => str | b'abc'.decode('utf-8)
|
if s.startswith(): ...
if s.endswith(): ...
|