Replacing a character by another character in a string in android?

后端 未结 3 810
有刺的猬
有刺的猬 2021-02-07 08:27

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.         


        
3条回答
  •  隐瞒了意图╮
    2021-02-07 08:50

    See code:

    et = (EditText) findViewById(R.id.editText1);
    String str = et.getText().toString();
    str = str.replace(' ', '_');
    System.out.println(str);
    

提交回复
热议问题