Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cheatsheet/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ The _Walrus Operator_, or **Assignment Expression Operator** was firstly introdu
String concatenation:

```python
>>> 'Alice' 'Bob'
>>> 'Alice' + 'Bob'
# 'AliceBob'
```

Expand Down
12 changes: 12 additions & 0 deletions docs/cheatsheet/manipulating-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ Raw strings are mostly used for <router-link to="/cheatsheet/regular-expressions
# Bob
```

## String literal concatenation

```python
>>> print("[A-Za-z_]" # letter or underscore
... "[A-Za-z0-9_]*" # letter, digit or underscore
... )

# [A-Za-z_][A-Za-z0-9_]*
```

Does not work with variables or expressions.

## Indexing and Slicing strings

H e l l o w o r l d !
Expand Down