title: Android Studio (Java) Replace function
body: <p>After googeling alot I still have no found the answer that I am looking for .. Hopefully you guys can point me into the right direction.</p>
  
  <p>Currently I have a working app using Android Studio which allows me to replace a word from user input to another word, basically a if else function. However, this won't allow me replace a whole sentence.</p>
  
  <p><strong>What I am trying to achieve is:</strong></p>
  
  <p>I want to have a text field where a user can input a text. </p>
  
  <p>For example, the user types: "Hello, I am John Doe and I like chocolate"</p>
  
  <p>The user the submits his entry using a send button. I then want a function which replaces only a certain word(s) within his input.</p>
  
  <p>For example, I want a function that replaces the word "chocolate" with "milk".</p>
  
  <p>So that the user gets a return from the system, saying: "Hello, I am John Doe and I like milk". But I also want it to replace words in between words. For example, I also want the function the replace the name "John" with "Mary".</p>
  
  <p>Which function can I use to achieve this scenario? </p>
  
  <p>Thanks for reading.</p>
  
  <p>Glenn</p>