X-Git-Url: http://git.euphorik.ch/?p=pompage.git;a=blobdiff_plain;f=doc%2Fwebdeveloper%2Fcommon%2Fstring.js;fp=doc%2Fwebdeveloper%2Fcommon%2Fstring.js;h=0000000000000000000000000000000000000000;hp=fd9709af5959384f488c3d2ea0144d98f4a86692;hb=eb7467621891b71883916c90f91bddf4c38d615f;hpb=de6efc861c1f471125cb4d3ab3d0f82572b3d21b diff --git a/doc/webdeveloper/common/string.js b/doc/webdeveloper/common/string.js deleted file mode 100644 index fd9709a..0000000 --- a/doc/webdeveloper/common/string.js +++ /dev/null @@ -1,31 +0,0 @@ -// Removes a substring from a string -function webdeveloper_removeSubstring(string, substring) -{ - // If the strings are not empty - if(string && substring) - { - var substringStart = string.indexOf(substring); - - // If the substring is found in the string - if(substring && substringStart != -1) - { - return string.substring(0, substringStart) + string.substring(substringStart + substring.length, string.length); - } - - return string; - } - - return ""; -} - -// Tests if a string ends with the given string -String.prototype.endsWith = function(endsWithString) -{ - return (this.substr(this.length - endsWithString.length) == endsWithString); -} - -// Trims leading and trailing spaces from a string -String.prototype.trim = function() -{ - return this.replace(new RegExp("^\\s+|\\s+$", "gi"), ""); -}