Created
August 28, 2019 15:51
-
-
Save nanotroy/37f7b7ec20e22ba627dd084f0aea169d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const capitalize = (str) => { | |
if (typeof str == 'string') { | |
if (str == 'realestate') { | |
return 'Real Estate'; | |
} | |
if (str == 'sundayreview') { | |
return 'Sunday Review'; | |
} | |
if (str == 'tmagazine') { | |
return 'T Magazine'; | |
} | |
return `${str[0].toUpperCase()}${str.slice(1)}`; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment