Description
Swaps the case of each character in a string - uppercase characters become lowercase and vice versa.Syntax
Parameters
Returns
Type: string A new string with all uppercase characters converted to lowercase and all lowercase characters converted to uppercase. Returnsnull if input is null.
Examples
Example 1: Basic Usage
Example 2: Swapping Mixed Case
Notes
- Returns
nullfornullinput - Non-alphabetic characters remain unchanged
- Applies to all characters in the string, not just the first
See Also
- text.capitalize - Uppercase the first character
- text.camelCase - Convert to camelCase format
- text.snakeCase - Convert to snake_case format
Frequently Asked Questions
Does flex.text.swapCase affect non-alphabetic characters?
Does flex.text.swapCase affect non-alphabetic characters?
No. Numbers, punctuation, and other non-alphabetic characters remain unchanged.
Is swapCase applied to all characters or just the first?
Is swapCase applied to all characters or just the first?
It is applied to every character in the string — each uppercase letter becomes lowercase and vice versa.