← Blog · · ConvertCaseHQ-Team · 1 Min. Lesezeit

Regex-Cheatsheet für Case-Umwandlung

Foto von Unsplash
// Split camelCase into words
"helloWorld".replace(/([a-z])([A-Z])/g, "$1 $2")

// Capitalize first letter of each word
str.replace(/\b\w/g, c => c.toUpperCase())

// Sentence case
str.toLowerCase().replace(/(^\s*\w|[.!?]\s+\w)/g, c => c.toUpperCase())

// Invert case
[...str].map(c => c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase()).join("")

© 2026 ConvertCaseHQ. Alle Rechte vorbehalten.