Text manipulation¶
Module for text manipulation functions.
This module contains functions for manipulating text.
Functions:
Name | Description |
---|---|
snake_to_sentense |
str) -> str: snake to title conversion |
kebab_to_sentense |
str) -> str: kebab to title conversion |
list_to_string |
list[str]) -> str: list to string conversion |
kebab_to_sentense(kebab_text)
¶
Convert kebab case text to title case text.
Convert kebab case text to title case text. The first letter of the first word is capitalized and the rest of the words are in lower case.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kebab_text
|
str
|
The kebab case text to convert to title case. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The title case text. |
Source code in app/dcsp/app/functions/text_manipulation.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
list_to_string(list_to_convert)
¶
Convert a list to a string
Take a list of strings and convert it to a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_to_convert
|
list[str]
|
The list to convert to a string. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
String of the list items. |
Source code in app/dcsp/app/functions/text_manipulation.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
snake_to_sentense(snake_text)
¶
Convert snake case text to title case text.
Convert snake case text to title case text. The first letter of the first word is capitalized and the rest of the words are in lower case.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
snake_text
|
str
|
The snake case text to convert to title case. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The title case text. |
Source code in app/dcsp/app/functions/text_manipulation.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|