rekaszeru
I noticed that you commented in 2011, but I thought I should post this answer anyway if someone should βreplace the original lineβ and stumble upon this answer.
I am using EditText as an example
// GIVE THE PURPOSE OF THE TEXT BOX NAME
EditText textbox = (EditText) findViewById(R.id.your_textboxID);
// STRING TO REPLACE
String oldText = "hello" String newText = "Hi"; String textBoxText = textbox.getText().toString();
// REPLACE ROWS WITH RETURNED LINES
String returnedString = textBoxText.replace( oldText, newText );
// USE RETURNING STRINGS TO REPLACE A NEW LINE INSIDE A TEXT TEXT
textbox.setText(returnedString);
This has not been tested, but this is just an example of using the returned string to replace the original layout string with setText ()!
Obviously, this example requires that you have an EditText with the identifier set for your textaxid
Zillinium Dec 03 '16 at 3:25 2016-12-03 03:25
source share