1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-15 10:07:07 +01:00

Package string utils.

This commit is contained in:
devlinjd
2015-09-26 15:05:37 -04:00
parent 8f6c639851
commit ad653e70dd
2 changed files with 19 additions and 8 deletions

18
src/utils/string.js Normal file
View File

@ -0,0 +1,18 @@
/**
String utility functions.
@license Copyright (c) 2015 by James M. Devlin. All rights reserved.
*/
/**
Determine if the string is null, empty, or whitespace.
See: http://stackoverflow.com/a/32800728/4942583
@method isNullOrWhitespace
*/
String.isNullOrWhitespace = function( input ) {
return !input || !input.trim();
};
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};