Back to bricks list
Introduction
Technical Documentation
Other Classes
StringHelper
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
GET_ENUM_VALUES - @staticmethod

Get all the values of an enum

Parameters:
NameTypeDefault valueDescription
enum_classType
Return type:
list
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
TO_SNAKE_CASE - @staticmethod

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

Parameters:
NameTypeDefault valueDescription
textstr
Return type:
str