Checks if a string is in kebab-case format.
A valid kebab-case string:
-
The input string
True if the string is kebab-case.
isKebabCase("hello-world") // trueisKebabCase("hello-world-123") // true Copy
isKebabCase("hello-world") // trueisKebabCase("hello-world-123") // true
isKebabCase("Hello-world") // falseisKebabCase("hello_world") // falseisKebabCase("-hello-world") // falseisKebabCase("hello-world-") // falseisKebabCase("hello--world") // false Copy
isKebabCase("Hello-world") // falseisKebabCase("hello_world") // falseisKebabCase("-hello-world") // falseisKebabCase("hello-world-") // falseisKebabCase("hello--world") // false
Checks if a string is in kebab-case format.
A valid kebab-case string:
-)