Files
hudozka/src/lib/string.js
T
2017-05-26 13:44:53 +03:00

13 lines
218 B
JavaScript

function titleCase(str) {
return str.charAt(0).toUpperCase() + str.slice(1)
}
function trim(string) {
return string
.replace(/^\s+/, '')
.replace(/\s+$/, '')
}
exports.titleCase = titleCase
exports.trim = trim