Update syntax highlighting, update allUnique
This commit is contained in:
@ -6,12 +6,12 @@ Returns the length of a string in bytes.
|
||||
|
||||
`utf-8` encodes a given string, then `len` finds the length of the encoded string.
|
||||
|
||||
```python
|
||||
```py
|
||||
def byte_size(string):
|
||||
return(len(string.encode('utf-8')))
|
||||
```
|
||||
|
||||
```python
|
||||
```py
|
||||
byte_size('😀') # 4
|
||||
byte_size('Hello World') # 11
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user