Python: String Prefix Char
String Prefix Char
a character may be prefixed to a string delimiter, to make the string of a particular type.
prefix chars:
u"abc"
→ means unicode string, in python 2. In python 3, all string are Unicode, the u prefex has no meaning.f"abc"
→ means f-String, where you can embed expression by{…}
.r"abc"
→ means Raw String. Escape Sequence is ignored.b"abc"
→ means Byte sequence.
Combine Prefix Characters
these prefix characters may be combined.
e.g. fr"abc"
means can embed expression and also raw (ignore Python: String Escape Sequence)
Python, String
- Python: Quote String
- Python: Triple Quote String
- Python: Raw String
- Python: String Prefix Char
- Python: f-String (Format, Template)
- Python: String Escape Sequence
- Python: Unicode Escape Sequence
- Python: Print String
- Python: Print Without Newline
- Python: Convert to String
- Python: Join String
- Python: Format String
- Python: String Methods
- Python: Search Substring
- Python: Split String
- Python: String, Check Case, Char Class
- Python: Letter Case Conversion
- Python: Unicode 🐍
- Python 2: Unicode Tutorial