Java String Substritute substituteSymbol(String text, String symbol, String value)

Here you can find the source of substituteSymbol(String text, String symbol, String value)

Description

substitute Symbol

License

LGPL

Declaration

public static String substituteSymbol(String text, String symbol, String value) 

Method Source Code

//package com.java2s;
//   jSMSEngine is distributed under the LGPL license.

public class Main {
    public static String substituteSymbol(String text, String symbol, String value) {
        StringBuffer buffer;//from   www. jav a 2s  .  co m

        while (text.indexOf(symbol) >= 0) {
            buffer = new StringBuffer(text);
            buffer.replace(text.indexOf(symbol), text.indexOf(symbol) + symbol.length(), value);
            text = buffer.toString();
        }
        return text;
    }
}

Related

  1. substituteNull(String value, String substitution)
  2. substitutePropertyWithIn(String propertyName, String replacementString, String evaluatedString)
  3. substituteSelectedCharacters(String text, boolean skip)
  4. substituteSpaces(String originalPath)
  5. substituteSubString(String input, String find, String replace)
  6. substituteSymbol(String text, String symbol, String value)
  7. substituteTabsAndNewLinesWithSpaces(String str)
  8. substituteText(String text, String token, String substitute)
  9. substituteToken(StringBuffer buf, String token, String value)