From 3f67d56a1b3acfbb17555e666b9be985212b3d03 Mon Sep 17 00:00:00 2001 From: Aaron Rosenzweig Date: Thu, 7 Feb 2013 18:40:50 -0500 Subject: [PATCH] Two helper methods These two helper methods are in some other open source libraries but we don't always include those. It bugged me enough that I added them here. Signed-off-by: Aaron Rosenzweig --- .../er/extensions/foundation/ERXStringUtilities.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXStringUtilities.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXStringUtilities.java index 1dd18c3b6cc..be4fa5da022 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXStringUtilities.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXStringUtilities.java @@ -2789,4 +2789,15 @@ public static String cleanString(String newString, NSArray toBeCleaneds) return result; } + public static boolean isBlank(String value) { + boolean isBlank = false; + if (value == null || value.trim().length() == 0) { + isBlank = true; + } + return isBlank; + } + + public static boolean isNotBlank(String value) { + return ! isBlank(value); + } }