For each character in the {@code string}, execute the {@link CharProcedure}.

@deprecated since 7.0. Use {@link #forEachChar(String, CharProcedure)} instead.
356679
@Deprecated
    public static void forEach(String string, CharProcedure procedure)
    {
        StringIterate.forEachChar(string, procedure);
    }
1139453
public static void setChar (@Nonnull final CharSequence aSeq, final int nIndex, final int nCodepoint)
  {
    if (!(aSeq instanceof StringBuilder) && !(aSeq instanceof StringBuffer))
    {
      setChar (new StringBuilder (aSeq), nIndex, nCodepoint);
    }
    else
    {
      int l = 1;
      int nI = nIndex;
      final char ch = aSeq.charAt (nI);
      final boolean high = Character.isHighSurrogate (ch);
      final boolean low = Character.isLowSurrogate (ch);
      if (high || low)
      {
        if (high && (nI + 1) < aSeq.length () && Character.isLowSurrogate (aSeq.charAt (nI + 1)))
          l++;
        else
        {
          if (low && nI > 0 && Character.isHighSurrogate (aSeq.charAt (nI - 1)))
          {
            nI--;
            l++;
          }
        }
      }
      if (aSeq instanceof StringBuffer)
        ((StringBuffer) aSeq).replace (nI, nI + l, getAsString (nCodepoint));
      else
        ((StringBuilder) aSeq).replace (nI, nI + l, getAsString (nCodepoint));
    }
  }
611287
@Override
    public String encode( String text ) {
        if (text == null) return null;
        StringBuilder sb = new StringBuilder();
        CharacterIterator iter = new StringCharacterIterator(text);
        for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
            switch (c) {
                case '&':
                    sb.append("&amp;");
                    break;
                case '"':
                    sb.append("&quot;");
                    break;
                case '<':
                    sb.append("&lt;");
                    break;
                case '>':
                    sb.append("&gt;");
                    break;
                case '\'':
                    sb.append("&#039;");
                    break;
                default:
                    sb.append(c);
            }
        }
        return sb.toString();
    }
1334357
@Deprecated
    public static void forEach(String string, final com.gs.collections.impl.block.procedure.primitive.CharProcedure procedure)
    {
        StringIterate.forEachChar(string, new CharProcedure()
        {
            public void value(char each)
            {
                procedure.value(each);
            }
        });
    }
1000673
public static void callStringBuilderAppendChar(CodeBuilder b) {
        // Because of JDK1.5 bug which exposes AbstractStringBuilder class,
        // cannot use reflection to get method signature.
        TypeDesc stringBuilder = TypeDesc.forClass(StringBuilder.class);
        b.invokeVirtual(stringBuilder, "append", stringBuilder, new TypeDesc[] {TypeDesc.CHAR});
    }
554711
@Deprecated
    public static String reject(String string, CharPredicate predicate)
    {
        return StringIterate.rejectChar(string, predicate);
    }
593715
public char parseChar(String name) {
        String property = getProperties().getProperty(name);
        if (property.length() != 1) {
            throw new IllegalArgumentException(name + " property is't char");
        }
        return property.charAt(0);
    }
927249
public static void forEachTrimmedToken(String string, String separator, Procedure<String> procedure)
    {
        for (StringTokenizer stringTokenizer = new StringTokenizer(string, separator); stringTokenizer.hasMoreTokens(); )
        {
            String token = stringTokenizer.nextToken().trim();
            procedure.value(token);
        }
    }
1300806
public static void forEachCodePoint(String string, CodePointProcedure procedure)
    {
        int size = string.length();
        for (int i = 0; i < size; )
        {
            int codePoint = string.codePointAt(i);
            procedure.value(codePoint);
            i += Character.charCount(codePoint);
        }
    }
1298294
public static int occurrencesOfChar(String string, final char value)
    {
        return StringIterate.countChar(string, new CharPredicate()
        {
            public boolean accept(char character)
            {
                return value == character;
            }
        });
    }
942757
@Deprecated
    public static Character detect(String string, CharPredicate predicate)
    {
        return StringIterate.detectChar(string, predicate);
    }
1265676
private static Charset getCharset(String charset)
    {
        try
        {
            return Charset.forName(charset);
        }
        catch (final UnsupportedCharsetException exception)
        {
            Verbose.exception(exception);
            return Charset.defaultCharset();
        }
    }
990187
@Deprecated
    public char next()
    {
        if (pos < end - 1) {
            pos++;
            return text.charAt(pos);
        }
        else {
            pos = end;
            return DONE;
        }
    }
308462
private int countChars(final char ch)
    {
        int count = 0;
        for (int i = 0; i < this.value.length(); i++)
        {
            final char c = this.value.charAt(i);
            if (c == ' ')
            {
                continue;
            }
            if (c == ch)
            {
                count++;
                continue;
            }
            count = 0;
            break;
        }
        return count;
    }
1235421
@SuppressWarnings("rawtypes")
	public String replace(String source,char replaceChar)
	{
		StringBuilder sb = new StringBuilder(source);
		char[] chars = source.toCharArray();
		int start = -1, end = -1;
		Map nowMap = pool;
		for (int i = 0; i < chars.length; i++)
		{
			char ch = Character.toUpperCase(chars[i]);
			nowMap = (Map) nowMap.get(ch);
			if (nowMap != null)
			{
				if (start == -1)
				{
					start = i;
				}
				if ("1".equals(nowMap.get("isEnd")))
				{
					end = i;
					for (int j = start; j <= end; j++)
					{
						sb.setCharAt(j, replaceChar);
					}
					start = -1; end = -1;
				}
			}
			else
			{
				start = -1;
				nowMap = pool;
				nowMap = (Map) nowMap.get(ch);
				if (nowMap != null)
				{
					if (start == -1)
					{
						start = i;
					}
					if ("1".equals(nowMap.get("isEnd")))
					{
						end = i;
						for (int j = start; j <= end; j++)
						{
							sb.setCharAt(j, replaceChar);
						}
						start = -1; end = -1;
					}
				}
				else
				{
					nowMap = pool;
				}
			}
		}
		return sb.toString();
	}
1369415
public void characters(final char[] ch, final int start, final int length) throws SAXException {
        charBuffer.append(ch, start, length);
    }
223249
function (ch) {
      // DEBUG "Processing `" + ch + "`:"
      var nextStates = this.nextStates,
          child,
          charSpec,
          chars;

      // DEBUG "  " + debugState(this)
      var returned = [];

      for (var i = 0, l = nextStates.length; i < l; i++) {
        child = nextStates[i];

        charSpec = child.charSpec;

        if (typeof (chars = charSpec.validChars) !== 'undefined') {
          if (chars.indexOf(ch) !== -1) {
            returned.push(child);
          }
        } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') {
          if (chars.indexOf(ch) === -1) {
            returned.push(child);
          }
        }
      }

      return returned;
    }