Browse files

Added an innerTrim method

  • Loading branch information...
1 parent 27064c2 commit 74a9654bbdc46f392bdb07ca4a45b1774337f49d @Sembiance committed Jul 14, 2014
Showing with 16 additions and 1 deletion.
  1. +15 −0 String.js
  2. +1 −1 package.json
View
15 String.js
@@ -82,6 +82,21 @@ if(!String.prototype.strip)
};
}
+if(!String.prototype.innerTrim)
+{
+ String.prototype.innerTrim = function()
+ {
+ var text = this;
+ var re = new RegExp(/\s\s/g);
+ while(re.test(text))
+ {
+ text = text.replace(re, " ");
+ }
+
+ return text;
+ };
+}
+
if(!String.prototype.capitalize)
{
View
2 package.json
@@ -1,6 +1,6 @@
{
"name" : "xbase",
- "version" : "1.1.6",
+ "version" : "1.1.7",
"author" : "Robert Schultz <robert@cosmicrealms.com>",
"description" : "common JS files used in all my JS projects",
"private" : true,

0 comments on commit 74a9654

Please sign in to comment.