Description
Converts a string to snake_case format by separating words with underscores and converting all characters to lowercase.Syntax
Parameters
Returns
Type: string The input string converted to snake_case format. Returns the original string if no matches are found. Returnsnull if input is null.
Examples
Example 1: Basic Usage
Example 2: Converting Multiple Formats
Example 3: Database Column Naming
Notes
- Returns
nullfornullinput - Handles multiple word boundary detection patterns
- All characters are converted to lowercase
- Words are separated by underscores
- Common for database column names and Python conventions
- Returns the original string if no word boundaries are detected
See Also
- text.camelCase - Convert to camelCase format
- text.upperCamelCase - Convert to UpperCamelCase format
Frequently Asked Questions
What separators does flex.text.snakeCase recognize?
What separators does flex.text.snakeCase recognize?
It recognizes spaces, hyphens, and camelCase/PascalCase word boundaries (transitions between lowercase and uppercase letters).
Are all characters lowercased?
Are all characters lowercased?
Yes. All characters in the output are converted to lowercase, with words separated by underscores.