From 2a71f0c9bc8321deb24fad1024d89cf1ea456a96 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 27 Sep 2006 00:31:03 +0000 Subject: [PATCH] Added getTinyClassName(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4381 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/ClassUtil.as | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/as/com/threerings/util/ClassUtil.as b/src/as/com/threerings/util/ClassUtil.as index f51bf68ed..9a96feedf 100644 --- a/src/as/com/threerings/util/ClassUtil.as +++ b/src/as/com/threerings/util/ClassUtil.as @@ -19,6 +19,13 @@ public class ClassUtil return s.replace("::", "."); } + public static function tinyClassName (obj :Object) :String + { + var s :String = getClassName(obj); + var dex :int = s.lastIndexOf("."); + return s.substring(dex + 1); // works even if dex is -1 + } + /** * Return a new instance that is the same class as the specified * object. The class must have a zero-arg constructor.