Skip to content

Text Case Conversion

Case conversion utilities.

Case Conversion Module

Functions for converting text between different case formats.

Modules

case_to_acronym

Functions

to_acronym_case(text: str) -> str

Convert a phrase to its acronym. Example: 'Random Access Memory' -> 'RAM'

Parameters: text (str): The phrase to convert.

Returns

str: The acronym of the phrase.

case_to_alphabet_position

Functions

to_alphabet_position_case(text: str) -> str

Replaces each letter with its position in the alphabet. Example: 'ab' -> '1 2'

Parameters: text (str): The text to process.

Returns

str: A string with each letter replaced by its alphabet position.

case_to_alternate_character_deletion

Functions

to_alternate_character_deletion_case(text: str) -> str

Deletes every alternate character in the text. Example: 'Hello' -> 'Hlo'

Parameters: text (str): The text to process.

Returns

str: The text with every alternate character deleted.

case_to_alternate_uppercase_lowercase

Functions

to_alternate_uppercase_lowercase_case(text: str) -> str

Alternates between uppercase and lowercase starting from the second character. Example: 'hello world' -> 'hElLo WoRlD'

Parameters: text (str): The text to convert.

Returns

str: The text with alternating uppercase and lowercase letters.

case_to_diagonal_text

Functions

to_diagonal_text_case(text: str) -> str

Creates a diagonal representation of the text. Note: This is a symbolic representation. Example: 'Hello' -> 'H e l l o'

Parameters: text (str): The text to convert.

Returns


str: The text in a diagonal representation.

case_to_first_letter_of_each_word

Functions

to_first_letter_of_each_word_case(text: str) -> str

Takes the first letter of each word to form a new string. Example: 'Hello World' -> 'HW'

Parameters: text (str): The text to convert.

Returns

str: A string formed by the first letter of each word.

case_to_leet_speak

Functions

to_leet_speak_case(text: str) -> str

Convert the text to leet speak (1337) case. Example: 'Leet Speak' -> '1337 5p34k'

Parameters: text (str): The text to convert.

Returns

str: The text in leet speak.

case_to_pig_latin

Functions

to_pig_latin_case(text: str) -> str

Translates text into Pig Latin. Example: 'hello' -> 'ellohay'

Parameters: text (str): The text to translate.

Returns

str: The text in Pig Latin.

case_to_random

Functions

to_random_case(text: str) -> str

Randomly change the case of each character in the text. Example: 'Hello World' -> 'hElLO wOrLD'

Parameters: text (str): The text to randomize case.

Returns

str: The text with randomized case.

case_to_slug

Functions

to_slug_case(text: str) -> str

Convert the text to slug case (URL-friendly format). Example: 'Hello World' -> 'hello-world'

Parameters: text (str): The text to convert to slug case.

Returns

str: The text in slug case.

case_to_spinal

Functions

to_spinal_case(text: str) -> str

Convert the text to spinal case (similar to kebab case). Lowers the case of each word and joins them with hyphens. Example: 'Hello World' -> 'hello-world'

Parameters: text (str): The text to convert.

Returns

str: The text converted to spinal case.

case_to_spongebob_meme

Functions

to_spongebob_meme_case(text: str) -> str

Alternates the case of each letter in a mocking manner, starting with uppercase. Example: 'spongebob case' -> 'SpOnGeBoB cAsE'

Parameters: text (str): The text to convert.

Returns

str: The text in Spongebob Meme case.

case_to_spongebob_mocking

Functions

to_mocking_spongebob_case(text: str) -> str

Convert the text to 'Mocking Spongebob' case (alternating case). Example: 'Hello World' -> 'hElLo wOrLd'

Parameters: text (str): The text to convert.

Returns

str: The text in 'Mocking Spongebob' case.

case_to_swap

Functions

to_swap_case(text: str) -> str

Swap the case of each character in the text. Example: 'Hello World' -> 'hELLO wORLD'

Parameters: text (str): The text whose case is to be swapped.

Returns

str: The text with swapped case.

case_to_upper_consonant

Functions

to_consonant_uppercase_case(text: str) -> str

Convert all consonants in the text to uppercase. Example: 'Hello World' -> 'hEllO wOrld'

Parameters: text (str): The text to convert.

Returns

str: The text with uppercase consonants.

case_to_upper_first_letter

Functions

to_upper_first_letter_case(text: str) -> str

Convert only the first letter of each word in the text to uppercase, the rest to lowercase. Example: 'hello world' -> 'Hello World'

Parameters: text (str): The text to convert.

Returns

str: The text with the first letter of each word in uppercase.

case_to_upper_vowel

Functions

to_vowel_uppercase_case(text: str) -> str

Convert all vowels in the text to uppercase. Example: 'Hello World' -> 'HEllO WOrld'

Parameters: text (str): The text to convert.

Returns

str: The text with uppercase vowels.

case_to_upside_down

Functions

to_upside_down_case(text: str) -> str

Flips the text upside down. Note: This method uses a limited character set for flipping.

Parameters: text (str): The text to flip.

Returns

str: The flipped text.

case_to_zalgo_text

Functions

to_zalgo_text_case(text: str) -> str

Add a glitch-like effect to the text with Zalgo characters. Note: This is a simplified version for demonstration.

Parameters: text (str): The text to convert.

Returns

str: The text with Zalgo effect.

to_camel_case

Camel Case Conversion

Convert text to camelCase format.

Functions

to_camel_case(text: str) -> str

Convert text to camelCase.

Converts the input text to camel case where the first word is lowercase and subsequent words are capitalized.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to camelCase.

Example

to_camel_case("hello world") 'helloWorld' to_camel_case("Hello World") 'helloWorld'

to_constant_case

Constant Case Conversion

Convert text to CONSTANT_CASE format.

Functions

to_constant_case(text: str) -> str

Convert text to CONSTANT_CASE.

Converts the input text to constant case (screaming snake case) by replacing spaces and special characters with underscores and converting to uppercase.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to CONSTANT_CASE.

Example

to_constant_case("Hello World") 'HELLO_WORLD' to_constant_case("helloWorld") 'HELLO_WORLD'

to_dot_case

Dot Case Conversion

Convert text to dot.case format.

Functions

to_dot_case(text: str) -> str

Convert text to dot.case.

Converts the input text to dot case by replacing spaces and special characters with dots and converting to lowercase.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to dot.case.

Example

to_dot_case("Hello World") 'hello.world' to_dot_case("helloWorld") 'hello.world'

to_kebab_case

Kebab Case Conversion

Convert text to kebab-case format.

Functions

to_kebab_case(text: str) -> str

Convert text to kebab-case.

Converts the input text to kebab case by replacing spaces and special characters with hyphens and converting to lowercase.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to kebab-case.

Example

to_kebab_case("Hello World") 'hello-world' to_kebab_case("helloWorld") 'hello-world'

to_lower_case

Lowercase Conversion

Convert text to lowercase format.

Functions

to_lower_case(text: str) -> str

Convert text to lowercase.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to lowercase.

Example

to_lower_case("Hello World") 'hello world'

to_pascal_case

Pascal Case Conversion

Convert text to PascalCase format.

Functions

to_pascal_case(text: str) -> str

Convert text to PascalCase.

Converts the input text to Pascal case where all words are capitalized and joined without separators.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to PascalCase.

Example

to_pascal_case("hello world") 'HelloWorld' to_pascal_case("hello_world") 'HelloWorld'

to_path_case

Path Case Conversion

Convert text to path/case format.

Functions

to_path_case(text: str) -> str

Convert text to path/case.

Converts the input text to path case by replacing spaces and special characters with forward slashes and converting to lowercase.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to path/case.

Example

to_path_case("Hello World") 'hello/world' to_path_case("helloWorld") 'hello/world'

to_sentence_case

Sentence Case Conversion

Convert text to Sentence case format.

Functions

to_sentence_case(text: str) -> str

Convert text to Sentence case.

Converts the input text to sentence case where only the first letter of the first word is capitalized and the rest is lowercase.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to Sentence case.

Example

to_sentence_case("hello world") 'Hello world' to_sentence_case("HELLO WORLD") 'Hello world'

to_snake_case

Snake Case Conversion

Convert text to snake_case format.

Functions

to_snake_case(text: str) -> str

Convert text to snake_case.

Converts the input text to snake case by replacing spaces and special characters with underscores and converting to lowercase.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to snake_case.

Example

to_snake_case("Hello World") 'hello_world' to_snake_case("helloWorld") 'hello_world'

to_title_case

Title Case Conversion

Convert text to Title Case format.

Functions

to_title_case(text: str) -> str

Convert text to Title Case.

Converts the input text to title case where the first letter of each word is capitalized.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to Title Case.

Example

to_title_case("hello world") 'Hello World' to_title_case("HELLO WORLD") 'Hello World'

to_upper_case

Uppercase Conversion

Convert text to UPPERCASE format.

Functions

to_upper_case(text: str) -> str

Convert text to UPPERCASE.

Parameters:

Name Type Description Default
text str

The text to convert.

required

Returns:

Type Description
str

The text converted to UPPERCASE.

Example

to_upper_case("Hello World") 'HELLO WORLD'

options: show_root_heading: true show_source: false heading_level: 2