Here you can find the source of substituteSymbol(String text, String symbol, String value)
public static String substituteSymbol(String text, String symbol, String value)
//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; } }