📜

Camel to Kebab Case

Camel to Kebab Case
보통 문자열 +20pts

Problem

Write a function that converts camelCase to kebab-case.

Examples

Input: camelToKebab("helloWorld")
Output: "hello-world"

Explanation

이 문제는 **정규표현식**과 **케이스 변환**을 학습합니다. 웹 개발에서 CSS 속성과 JavaScript 속성 간 변환에 자주 사용됩니다. **케이스 스타일** - camelCase: backgroundColor (JavaScript) - kebab-case: background-color (CSS) - snake_case: background_color (Python) **정규표현식 분석: /([A-Z])/g** - `[A-Z]`: 대문자 A-Z 중 하나 - `()`: 캡처 그룹 (매치된 문자를 저장) - `g`: 전역 ...

View detailed explanation →

Key Concepts

정규표현식 캡처 그룹 replace 메서드 케이스 변환 $1 참조
Time: O(n) Space: O(n)
solution.js
Ctrl + Enter
Run tests to see results here.