diff --git a/src/as/com/threerings/util/StringUtil.as b/src/as/com/threerings/util/StringUtil.as index 73603c523..b73a6effa 100644 --- a/src/as/com/threerings/util/StringUtil.as +++ b/src/as/com/threerings/util/StringUtil.as @@ -34,6 +34,15 @@ public class StringUtil return (startDex >= 0) && (str.indexOf(substr, startDex) >= 0); } + /** + * Does the specified string start with the specified substring. + */ + public static function startsWith (str :String, substr :String) :Boolean + { + // just check once if it's at the beginning + return (str.lastIndexOf(substr, 0) == 0); + } + /** * Utility function that strips whitespace from the ends of a String. */