graveyard/tools/org/apache/axis/tools/cbindings/CBindingGenerator.java
/**
     * Replaces from with to in text, excluding strings that start with exclude.
     */
Replaces from with to in text, excluding strings that start with exclude.
Replaces from with to in text excluding strings that start with exclude .
private static String replaceInString(String text, String from, String to, String exclude) throws Exception 
    {
        int idx = 0;
        while (-1 != text.indexOf(from, idx)) 
        {
            int start = text.indexOf(from, idx);
            if (null == exclude || text.indexOf(exclude, idx) != start) 
            {
                text = text.substring(0, start) + to + text.substring(start + from.length());
                idx = start + to.length();
            } 
            else 
                idx = start + exclude.length();
        }
        return text;
    }
private static String replaceInString ( String text , String from , String to , String exclude ) throws Exception { int idx = 0 ; while ( - 1 != text . indexOf ( from , idx ) ) { int start = text . indexOf ( from , idx ) ; if ( null == exclude || text . indexOf ( exclude , idx ) != start ) { text = text . substring ( 0 , start ) + to + text . substring ( start + from . length ( ) ) ; idx = start + to . length ( ) ; } else idx = start + exclude . length ( ) ; } return text ; }
Replaces from with to in text, excluding strings that start with exclude.
Replaces from with to in text excluding strings that start with exclude .