diff --git a/js/h5p.js b/js/h5p.js index d02b5ce..a8b585a 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -190,6 +190,16 @@ H5P.cloneObject = function (object, recursive, array) { return clone; }; +/** + * Remove all empty spaces before and after the value. + * + * @param {String} value + * @returns {@exp;value@call;replace} + */ +H5P.trim = function (value) { + return value.replace(/^\s+|\s+$/g, ''); +}; + // We have several situations where we want to shuffle an array, extend array // to do so. Array.prototype.shuffle = function() {