Convert Case

Convert Case

Convert Case refers to the process of changing the capitalization style of a text string. It is a common feature in programming, text processing, and web applications to make text consistent, readable, or suitable for specific uses like URLs, class names, or user interfaces.

Why Convert Case?

  • Consistency: Ensure all text follows a uniform format.

  • Readability: Make text easier to read for users.

  • Data processing: Normalize text before saving in databases or performing searches.

  • Programming conventions: Follow coding standards, like camelCase for variables or StudlyCase for classes.


Common Case Types

  1. Lowercase
    Converts all letters to lowercase.
    Example: "Hello World""hello world"

  2. Uppercase
    Converts all letters to uppercase.
    Example: "Hello World""HELLO WORLD"

  3. Capitalized / Title Case
    Capitalizes the first letter of each word.
    Example: "hello world""Hello World"

  4. Sentence Case
    Capitalizes only the first letter of the sentence; the rest is lowercase.
    Example: "hELLO WORLD!""Hello world!"

  5. Camel Case
    The first word is lowercase, and each following word starts with an uppercase letter. Common in variable names.
    Example: "hello world""helloWorld"

  6. Studly / Pascal Case
    Each word starts with an uppercase letter. Common for class names.
    Example: "hello world""HelloWorld"

  7. Snake Case
    Words are lowercase and separated by underscores. Common in database columns.
    Example: "Hello World""hello_world"

  8. Kebab Case
    Words are lowercase and separated by hyphens. Common in URLs.
    Example: "Hello World""hello-world"

  9. Alternating Case
    Letters alternate between lowercase and uppercase.
    Example: "hello world""hElLo WoRlD"

  10. Inverse / Swap Case
    Uppercase letters become lowercase, and lowercase letters become uppercase.
    Example: "Hello World""hELLO wORLD"