From 46bb00112287b0e9b7ce51cacd6f70f7519baab1 Mon Sep 17 00:00:00 2001 From: josev Date: Fri, 29 Apr 2011 16:59:07 -0700 Subject: [PATCH] Add contains() for StringUtils closes #129 --- src/com/adobe/utils/StringUtil.as | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/com/adobe/utils/StringUtil.as b/src/com/adobe/utils/StringUtil.as index d7e98ed..5e38bfc 100644 --- a/src/com/adobe/utils/StringUtil.as +++ b/src/com/adobe/utils/StringUtil.as @@ -235,5 +235,24 @@ package com.adobe.utils //todo: this needs a unit test return (s != null && s.length > 0); } + + + /** + * Returns true if and only if the input string contains the specified sequence value. + * + * @param input The string in which we are searching for the sequence + * @param sequence The string to search for + * + * @returns true if input contains sequence, false otherwise + * + * @langversion ActionScript 3.0 + * @playerversion Flash 9.0 + * @tiptext + */ + public static function contains(input:String, sequence:String):Boolean + { + return input != null && input.indexOf(sequence) >= 0; + } + } } \ No newline at end of file