android - How to Replace a string with the Indian Rupee's symbol -


i developing application needs indian rupee's symbol string

result=rs 0 code replace string

if (result.contains("rs")) {      result.replace("rs","₹");      menuitem balance = menu.finditem(r.id.action_balance);      spannablestring s = new spannablestring(result);      s.setspan(new foregroundcolorspan(color.blue), 0, s.length(), 0);      balance.settitle(s); } 

result.replace("rs","₹"); string had copied net had done this

<string name="rs">\u20b9</string>   result.replace("rs",getresources().getstring(r.string.rs)); 

but doesn't work anything... other option there please answer it

below code working

 <string name="rs">\u20b9</string> 

in code :

     menuitem balance = menu.finditem(r.id.action_balance);      spannablestring s = new spannablestring(result.replace("rs",getresources().getstring(r.string.rs)));      s.setspan(new foregroundcolorspan(color.blue), 0, s.length(), 0);      balance.settitle(s); 

or edit code :

if (result.contains("rs")) {      result = result.replace("rs","₹");      menuitem balance = menu.finditem(r.id.action_balance);      spannablestring s = new spannablestring(result);      s.setspan(new foregroundcolorspan(color.blue), 0, s.length(), 0);      balance.settitle(s); } 

or edit code :

<string name="rs">\u20b9</string>   result = result.replace("rs",getresources().getstring(r.string.rs)); 

Comments