Python/String: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
Line 13: Line 13:
! || Sample
! || Sample
|-
|-
| byte => str || <source lang="python">b'abc'.decode('utf-8)</source>
| byte => str
| <source lang="python">
b'abc'.decode('utf-8)
</source>
|-
|-
|
| Prefix & Suffix
| <source lang="python">
| <source lang="python">
if s.startswith(): ...
if s.startswith(): ...

Revision as of 16:50, 21 March 2018

Using statements

Using methods

Sample
byte => str
b'abc'.decode('utf-8)
Prefix & Suffix
if s.startswith(): ...
if s.endswith(): ...