From 7780fa0ad53baaa4b24803bf3e30933eed16294f Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Sun, 14 Mar 2010 17:42:08 +0000 Subject: [PATCH] Oops, experiment in progress. Back out last change. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922910 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/lang3/CharSequenceUtils.java | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java index 97ddd1bb3..5bda1fb9a 100644 --- a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java @@ -83,39 +83,4 @@ public class CharSequenceUtils { public static CharSequence subSequence(CharSequence cs, int start) { return cs == null ? null : cs.subSequence(start, cs.length()); } - - public static int indexOf(CharSequence cs, int ch, int startPos) { - int max = cs.length(); - - if (startPos < 0) { - startPos = 0; - } else if (startPos >= max) { - return StringUtils.INDEX_NOT_FOUND; - } - - if (ch < Character.MIN_SUPPLEMENTARY_CODE_POINT) { - for (int i = startPos; i < max; i++) { - if (cs.charAt(i) == ch) { - return i; - } - } - return StringUtils.INDEX_NOT_FOUND; - } - - // supp chars - if (ch <= Character.MAX_CODE_POINT) { - char[] surrogates = Character.toChars(ch); - for (int i = startPos; i < max; i++) { - if (cs.charAt(i) == surrogates[0]) { - if (i + 1 == max) { - break; - } - if (cs.charAt(i + 1) == surrogates[1]) { - return i; - } - } - } - } - return StringUtils.INDEX_NOT_FOUND; - } }