Skip to content

Instantly share code, notes, and snippets.

@guelau
Created May 7, 2019 12:17
Show Gist options
  • Save guelau/c082c85a1ff9f3726d84c0910c16aa64 to your computer and use it in GitHub Desktop.
Save guelau/c082c85a1ff9f3726d84c0910c16aa64 to your computer and use it in GitHub Desktop.
var util = {
has: function (str1, str2) {
if (typeof str1 === 'string') {
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1
} else {
return false
}
},
lowerize: function (str) {
return str.toLowerCase()
},
trim: function (str) {
return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment