View on GitHub

marymafa.github.io


layout: post title: Spinal Tap Case date: 2017-11-13 —-

Spinal Tap Case

About spinal case

Spinal case is all lower case words joined by dashes.

I have created my own rules:

1.Replace all spaces with a dash.

2.Change the whole word to lower case.

3.If the letter is in upper case, change it to lower case.

My Approach

Method 1:

I created the second function called is spaced or underscore that should join the word by dash or dashes if there is a space and undescore between the words.

Method 2:

I created the third function called is upper case, if the letter is in upper case, change it to lower case.

Method 3:

On my first statement, i said if string has undersore and space between the words then replace them by dash or dashes.

Method 4:

on my second statement , i said if letter is in upper case and greater than zero and is not spaced or underscore then the result should be the lower case letter that is spaced.

method 5:

On my last statement , if the words is in upper and does not have space o underscore then convert it to lower case and join it with dash or if the words is in lowewr case and does not have space o underscore then join it with dash or dashes.

On this exercise i have learned that following the strategies makes this to be mush easier even though it was challenging .