From 9a50e5f79174d1a3430479afb0d399f6b1af414e Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 28 Apr 2009 00:07:25 +0000 Subject: [PATCH] Added compare(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5752 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 286d89a09..991cf5c93 100644 --- a/src/as/com/threerings/util/StringUtil.as +++ b/src/as/com/threerings/util/StringUtil.as @@ -29,6 +29,14 @@ import flash.utils.getQualifiedClassName; public class StringUtil { + /** + * Compares two String values, returning -1, 0, or 1. + */ + public static function compare (s1 :String, s2 :String) :int + { + return (s1 > s2) ? 1 : (s1 == s2 ? 0 : -1); + } + /** * Get a reasonable hash code for the specified String. */