1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-10-06 15:35:11 +01:00
HackMyResume/src/utils/string.js

19 lines
422 B
JavaScript
Raw Normal View History

2015-09-26 20:05:37 +01:00
/**
String utility functions.
2015-10-06 17:21:22 +01:00
@license Copyright (c) 2015 | James M. Devlin
2015-09-26 20:05:37 +01:00
*/
/**
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;
};