Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

commit stringUtil

提交stringUtil.js
  • Loading branch information...
commit 2276f74a70bdd8fe34aff7b7bad44967c4cf024a 1 parent 0f1d596
@lenbo-ma authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/stringUtil.js
View
16 lib/stringUtil.js
@@ -0,0 +1,16 @@
+
+
+exports.trim = function(str)
+{
+ return str.replace(/(^\s*)|(\s*$)/g, "");
+}
+
+exports.ltrim = function(str)
+{
+ return str.replace(/(^\s*)/g, "");
+}
+
+exports.rtrim = function(str)
+{
+ return str.replace(/(\s*$)/g, "");
+}
Please sign in to comment.
Something went wrong with that request. Please try again.