camelToKebab

Converts a camelCase string to a kebab-case string.

This function converts a camelCase string to a kebab-case string.

Parameters

  • str {string}: The camelCase string to convert.

Returns

  • {string}: The converted kebab-case string.

// Example 1
const result1 = camelToKebab('camelCaseString');
console.log(result1); // Output: camel-case-string

// Example 2
const result2 = camelToKebab('anotherExampleString');
console.log(result2); // Output: another-example-string

Last updated