InstruçÔes
Implemente um Conversor de Spinal Case
Spinal case Ă© um formato de string onde todas as palavras estĂŁo em letras minĂșsculas e separadas por hĂfens.
"this-is-spinal-tap" Ă© um exemplo de uma string em spinal case.
Neste laboratĂłrio, vocĂȘ criarĂĄ uma função que converte uma string dada para spinal case.
Objetivo: Cumprir as user stories abaixo e fazer com que todos os testes passem para completar o laboratĂłrio.
HistĂłrias de UsuĂĄrio:
1. VocĂȘ deve criar uma função chamada spinalCase.
2. A função spinalCase deve receber um Ășnico argumento, uma string.
3. A função spinalCase deve retornar a string no formato spinal case. Por exemplo, se o argumento for ProductLanding page, a função deve retornar product-landing-page.
O que fazer:
Testes:
- VocĂȘ deve criar uma função chamada `spinalCase`.
- `spinalCase` deve receber um Ășnico argumento.
- `spinalCase("This Is Spinal Tap")` deve retornar a string `this-is-spinal-tap`.
- `spinalCase("thisIsSpinalTap")` deve retornar a string `this-is-spinal-tap`.
- `spinalCase("The_Andy_Griffith_Show")` deve retornar a string `the-andy-griffith-show`.
- `spinalCase("Teletubbies say Eh-oh")` deve retornar a string `teletubbies-say-eh-oh`.
- `spinalCase("AllThe-small Things")` deve retornar a string `all-the-small-things`.
Preview