Login
Back to bricks list
Introduction Version

StringHelper

Helper to manipulate strings

Functions

GENERATE_UUID - @classmethod
Return type:
str
CAMEL_CASE_TO_SENTENCE - @staticmethod

Convert a camel case to sentence like Ex 'TestClass2Build' -> 'Test class2 build'

Parameters:
NameTypeDefault valueDescription
namestr [description]
Return type:
str
GENERATE_RANDOM_CHARS - @staticmethod
Parameters:
NameTypeDefault valueDescription
sizeint 6
charsstr ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Return type:
str
IS_ALPHANUMERIC - @staticmethod

Check if a string is alphanumeric with underscore

Parameters:
NameTypeDefault valueDescription
str_str
Return type:
bool
REMOVE_WHITESPACES - @staticmethod

Remove all whitespace of a string

Parameters:
NameTypeDefault valueDescription
str_str
Return type:
str
REPLACE_ACCENT_WITH_LETTER - @staticmethod

Replace accent with letter

Parameters:
NameTypeDefault valueDescription
str_str
Return type:
str
SLUGIFY - @staticmethod

Returns the slugified text

Parameters:
NameTypeDefault valueDescription
textstr Text to slugify ``
snakefybool False Snakefy the text if true (i.e. uses undescores instead of dashes to separate text words), defaults to false ``
to_lowerbool True True to lower all characters, false otherwise ``
Return type:
str
SNAKE_CASE_TO_SENTENCE - @staticmethod

Convert a snake case to sentence like Ex 'test_class2_build' -> 'Test class2 build'

Parameters:
NameTypeDefault valueDescription
namestr
Return type:
str
TO_ENUM - @staticmethod

Convert a string to an enum value

Parameters:
NameTypeDefault valueDescription
enum_classType
str_valuestr
Return type:
Any
TO_PASCAL_CASE - @staticmethod

Convert a text to pascal case Ex 'test_class2_build' -> 'TestClass2Build'

Parameters:
NameTypeDefault valueDescription
textstr
Return type:
str