/** * Finds the first occurrence of any of the supplied characters * * @param S the <code>String</code> to search * @param chars the characters to look for * * @return the index of the first occurrence of <code>-1</code> if none found */ public static int indexOf(String S, char[] chars) { return indexOf(S, chars, 0); }
/** * Removes all occurrences of a <code>char</code> from a <code>String</code> * * @deprecated this method is slow and no longer supported */ @Deprecated public static String removeChars(String S, char[] chars) { int pos; while((pos=indexOf(S, chars))!=-1) S=S.substring(0,pos)+S.substring(pos+1); return S; }
StringBuilder SB = new StringBuilder(href.length()*2); // Leave a little room for encoding while(pos<len) { int nextPos = StringUtility.indexOf(href, noEncodeCharacters, pos); if(nextPos==-1) { SB.append(URLDecoder.decode(href.substring(pos, len), encoding));
int nextPos = StringUtility.indexOf(href, noEncodeCharacters, pos); if(nextPos == -1) { SB.append(URLEncoder.encode(href.substring(pos, stopAt), encoding));