Simply i want to replace a character with another in android.. My code:
et = (EditText) findViewById(R.id.editText1); String str = et.getText().toString(); str.
Strings are immutable in Java - replace doesn't change the existing string, it returns a new one. You want:
replace
str = str.replace(' ','_');
(This is definitely a duplicate, but I don't have enough time right now to find an appropriate one...)