🛠️ToolsShed

대소문자 변환

텍스트를 UPPERCASE, lowercase, Title Case, camelCase 등으로 변환.

UPPERCASE

결과가 여기에 표시됩니다...

lowercase

결과가 여기에 표시됩니다...

Title Case

결과가 여기에 표시됩니다...

Sentence case

결과가 여기에 표시됩니다...

camelCase

결과가 여기에 표시됩니다...

snake_case

결과가 여기에 표시됩니다...

kebab-case

결과가 여기에 표시됩니다...

aLtErNaTiNg

결과가 여기에 표시됩니다...

대소문자 변환기는 텍스트를 다양한 대소문자 형식으로 즉시 변환합니다. 제목에 필요한 UPPERCASE, 이메일 주소를 위한 lowercase, 책 제목을 위한 Title Case, 또는 프로그래밍 변수명을 위한 camelCase 등 모든 일반적인 대소문자 변환을 지원합니다.

텍스트를 붙여넣고 원하는 출력 형식을 선택하세요. 지원되는 변환에는 UPPER CASE, lower case, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case가 포함됩니다.

대소문자 변환은 프로그래밍 워크플로에서 특히 유용합니다. JavaScript는 변수에 camelCase, Python은 snake_case, CSS는 kebab-case, 대부분의 객체 지향 언어는 클래스명에 PascalCase를 사용합니다.

자주 묻는 질문

코드 구현

import re

def to_words(text: str) -> list[str]:
    """Split text into words, handling camelCase, snake_case, kebab-case, and spaces."""
    text = re.sub(r"([a-z])([A-Z])", r"\1 \2", text)  # camelCase split
    text = re.sub(r"[_\-]+", " ", text)                  # snake/kebab to space
    return [w for w in text.strip().split() if w]

def to_camel_case(text: str) -> str:
    words = to_words(text)
    return words[0].lower() + "".join(w.capitalize() for w in words[1:])

def to_pascal_case(text: str) -> str:
    return "".join(w.capitalize() for w in to_words(text))

def to_snake_case(text: str) -> str:
    return "_".join(w.lower() for w in to_words(text))

def to_kebab_case(text: str) -> str:
    return "-".join(w.lower() for w in to_words(text))

def to_screaming_snake(text: str) -> str:
    return "_".join(w.upper() for w in to_words(text))

# Example usage
text = "hello world example"
print(to_camel_case(text))      # helloWorldExample
print(to_pascal_case(text))     # HelloWorldExample
print(to_snake_case(text))      # hello_world_example
print(to_kebab_case(text))      # hello-world-example
print(to_screaming_snake(text)) # HELLO_WORLD_EXAMPLE

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.