I have the following String.replace() call that somehow is not working!
<code>String symbol=AlgoCalc.the_inequalitySymbol;
Log.d("looky_","in here! " + symbol + " :: " + symbol.contains(">"));
if(symbol.contains(">"))symbol=symbol.replace(">","<");
if(symbol.contains("<"))symbol=symbol.replace("<",">");
Log.d("looky_","in here! after:: " + symbol);
</code>
<code>String symbol=AlgoCalc.the_inequalitySymbol;
Log.d("looky_","in here! " + symbol + " :: " + symbol.contains(">"));
if(symbol.contains(">"))symbol=symbol.replace(">","<");
if(symbol.contains("<"))symbol=symbol.replace("<",">");
Log.d("looky_","in here! after:: " + symbol);
</code>
String symbol=AlgoCalc.the_inequalitySymbol;
Log.d("looky_","in here! " + symbol + " :: " + symbol.contains(">"));
if(symbol.contains(">"))symbol=symbol.replace(">","<");
if(symbol.contains("<"))symbol=symbol.replace("<",">");
Log.d("looky_","in here! after:: " + symbol);
I keep getting symbol to be what it was! the first Log statement prints: symbol.contains(“>”)) = true So, the if statement should execute and do a correct replace call.
I even tried with a replaceAll call!
Are the symbols > AND < reserved in Java? What is going on?