diff options
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java b/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java index 728968e..2f8aa09 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java @@ -11,6 +11,27 @@ import java.util.Deque; public class StringUtils { /** + * Checks if the given expression contains the specified operator in a + * situation that indicates its use as an infix operator. + * + * @param expression + * The expression to check + * @param operator + * The operator to see if it is contained + * @return Whether or not the given expression contains the specified + * operator as a infix operator + */ + public static boolean containsInfixOperator(String expression, + String operator) { + // Bit annoying to have to use a full class name, but what are you + // going to do? + return org.apache.commons.lang3.StringUtils + .countMatches(expression, operator) == 1 + && !expression.equalsIgnoreCase(operator) + && !expression.startsWith(operator); + } + + /** * Check if a string consists only of one or more matches of a regular * expression * @@ -40,27 +61,6 @@ public class StringUtils { } /** - * Checks if the given expression contains the specified operator in a - * situation that indicates its use as an infix operator. - * - * @param expression - * The expression to check - * @param operator - * The operator to see if it is contained - * @return Whether or not the given expression contains the specified - * operator as a infix operator - */ - public static boolean containsInfixOperator(String expression, - String operator) { - // Bit annoying to have to use a full class name, but what are you - // going to do? - return org.apache.commons.lang3.StringUtils - .countMatches(expression, operator) == 1 - && !expression.equalsIgnoreCase(operator) - && !expression.startsWith(operator); - } - - /** * Indent the string being built in a StringBuilder n levels * * @param builder |
