From 50b8e41db0f0238768bff62dbfeae23fd30fcf18 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 7 Nov 2007 17:26:00 +0000 Subject: [PATCH] added another convenience method. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5776 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Util.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index f5253a7e99..635213941b 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -515,6 +515,16 @@ public class Util { return s; } + /** + * Convert empty string to null, and trim whitespace. + * + * @since 1.154 + */ + public static String fixEmptyAndTrim(String s) { + if(s==null) return null; + return s.trim(); + } + /** * Cuts all the leading path portion and get just the file name. */ -- GitLab