summaryrefslogtreecommitdiff
path: root/s.el
diff options
context:
space:
mode:
authorguobao.jiang <loveaborn@foxmail.com>2016-09-22 09:49:42 +0800
committerguobao.jiang <loveaborn@foxmail.com>2016-09-22 09:49:42 +0800
commitaa8571304c7cb85cdf814d3fc42bfe38577bfbbb (patch)
tree29d8dd076d5e2774d49c8d8b75c1f5105cea5046 /s.el
parenta767c1c04c3accef0bdd5e7e785f6dbee6dd85b8 (diff)
add s-blank-str?
Diffstat (limited to 's.el')
-rw-r--r--s.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/s.el b/s.el
index efd9a54..19025d5 100644
--- a/s.el
+++ b/s.el
@@ -292,6 +292,10 @@ This is a simple wrapper around the built-in `string-match-p'."
"Is S nil or the empty string?"
(or (null s) (string= "" s)))
+(defun s-blank-str? (s)
+ "Is S nil or the empty string or string only contains whitespace?"
+ (or (s-blank? s) (s-blank? (s-trim s))))
+
(defun s-present? (s)
"Is S anything but nil or the empty string?"
(not (s-blank? s)))