Update snake.md
This commit is contained in:
@ -11,9 +11,9 @@ Break the string into words and combine them adding `_` as a separator, using a
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
def snake(str):
|
def snake(str):
|
||||||
return '_'.join(re.sub('([A-Z][a-z]+)', r' \1',
|
return '_'.join(re.sub('([A-Z][a-z]+)', r' \1',
|
||||||
re.sub('([A-Z]+)', r' \1',
|
re.sub('([A-Z]+)', r' \1',
|
||||||
str.replace('-', ' '))).split()).lower()
|
str.replace('-', ' '))).split()).lower()
|
||||||
```
|
```
|
||||||
|
|
||||||
```py
|
```py
|
||||||
|
|||||||
Reference in New Issue
Block a user