#C125. Kebab Case Conversion

    ID: 41933 Type: Default 1000ms 256MiB

Kebab Case Conversion

Kebab Case Conversion

Given a string, convert it into kebab-case by following these rules:

1. Remove all punctuation characters (i.e., any character that is not alphanumeric or an underscore).
2. Trim leading and trailing spaces.
3. Convert all letters to lowercase.
4. Replace one or more consecutive whitespace characters by a single hyphen ((-)).

For example, the string "Hello, World!" should be converted to "hello-world". If the input is empty or contains only whitespace or punctuation, the output should be an empty string.

Input is read from standard input (stdin) and the output should be printed to standard output (stdout).

inputFormat

A single line string that may contain letters, digits, spaces, punctuation, and other ASCII characters. It is provided via standard input (stdin).

outputFormat

A single line string representing the kebab-case conversion of the input.## sample

Hello, World!
hello-world