Skip to main content

Module string_utils

Module string_utils 

Source
Expand description

String manipulation utilities

Functions§

escape_json_string
Escape a string for JSON
extract_template_variables
Extract variables from a template string (e.g., “Hello {name}”)
is_valid_semver
Check if a string is a valid semantic version
random_alphanumeric
Generate a random alphanumeric string
random_string
Generate a random string with specified length and character set
replace_template_variables
Replace variables in a template string
sanitize_identifier
Sanitize a string for safe use in identifiers
to_camel_case
Convert a string to camelCase
to_pascal_case
Convert a string to PascalCase
to_snake_case
Convert a string to snake_case
truncate_with_ellipsis
Truncate a string to a maximum length with ellipsis