From d48921acc219d410113fa0d9cdf9b67d8a39ee31 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 25 Sep 2008 20:55:55 +0000 Subject: [PATCH] Added deNull(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5392 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/StringUtil.as | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/as/com/threerings/util/StringUtil.as b/src/as/com/threerings/util/StringUtil.as index 7c700daf0..c6d673178 100644 --- a/src/as/com/threerings/util/StringUtil.as +++ b/src/as/com/threerings/util/StringUtil.as @@ -53,6 +53,14 @@ public class StringUtil return (str == null) || (str.search("\\S") == -1); } + /** + * Return the specified String, or "" if it is null. + */ + public static function deNull (str :String) :String + { + return (str == null) ? "" : str; + } + /** * Does the specified string end with the specified substring. */