aboutsummaryrefslogtreecommitdiff
path: root/src/utils/stringUtils.js
blob: f28841c88caf3e95f38a5e3bc17ecc6d92e8e1c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module.exports = {
    
    firstLetterCapital: firstLetterCapital,

    firstLetterWordCapital: firstLetterWordCapital

}

function firstLetterCapital(string) {
    return string.substr(0, 1).toUpperCase() + string.substr(1)
}

function firstLetterWordCapital(string) {
    return string.split(" ").map(firstLetterCapital).join(" ")
}