From ad4f36729b20a549393923040a97809554f27c6e Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 7 Dec 2006 21:26:05 +0000 Subject: [PATCH] Import mx's StringUtil.substitute() into our own StringUtil, as it's annoying to have two StringUtils. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4475 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/MessageBundle.as | 4 +--- src/as/com/threerings/util/StringUtil.as | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/as/com/threerings/util/MessageBundle.as b/src/as/com/threerings/util/MessageBundle.as index 7faadecf0..fa8a07d26 100644 --- a/src/as/com/threerings/util/MessageBundle.as +++ b/src/as/com/threerings/util/MessageBundle.as @@ -23,8 +23,6 @@ package com.threerings.util { import mx.resources.ResourceBundle; -import mx.utils.StringUtil; - /** * A message bundle provides an easy mechanism by which to obtain * translated message strings from a resource bundle. It uses the {@link @@ -180,7 +178,7 @@ public class MessageBundle return (key + args); } - return mx.utils.StringUtil.substitute(msg, args); + return StringUtil.substitute(msg, args); } /** diff --git a/src/as/com/threerings/util/StringUtil.as b/src/as/com/threerings/util/StringUtil.as index 95ad53e0a..39ccd0ee2 100644 --- a/src/as/com/threerings/util/StringUtil.as +++ b/src/as/com/threerings/util/StringUtil.as @@ -91,6 +91,14 @@ public class StringUtil return str; } + /** + * Substitute "{n}" tokens for the corresponding passed-in arguments. + */ + public static function substitute (str :String, ... args) :String + { + return mx.utils.StringUtil.substitute(str, args); + } + /** * Utility function that strips whitespace from the ends of a String. */