title: How do i check if string contains a part of a string?
body: <p>I did:</p>
  
  <pre><code>public static String textforspeech = "";
  </code></pre>
  
  <p>Then:</p>
  
  <pre><code>                        String a = null;
                          try
                          {
                              a = new String(checkServer, "UTF-8");
                              textforspeech = a;
                              if (textforspeech.equals("upload completed"))
                                  MainActivity.this.initTTS();
                              if (textforspeech.equals("uploading"))
                              {
                                  servercheckCounter += 1;
                                  if (servercheckCounter == 1)
                                  {
                                      MainActivity.this.initTTS();
                                  }
                              }
                          } catch (UnsupportedEncodingException e)
                          {
                              e.printStackTrace();
                          }
  </code></pre>
  
  <p>What i'm doing is:</p>
  
  <pre><code>if (textforspeech.equals("uploading"))
  </code></pre>
  
  <p>But now i changed it and textforspeech will contain:</p>
  
  <p>uploading 345445</p>
  
  <p>Then in a next update it will be:</p>
  
  <p>uploading 345446</p>
  
  <p>Then:</p>
  
  <p>uploading 345447</p>
  
  <p>Somehow i want to check if textforspeech contains "uploading" and if it does parse the number from the string. I know that if it does contains "uploading" it's also contain the number that will be update each time.</p>
  
  <p>How do i check if it contains "uploading" and then how do i parse the number so in the end i will have two strings variables one contain all the time the "uploading" and one will contain the number "345445" then "uploading" and "345446" not a new string each time the number is updated just to parse the "uploading" and the number to two strings.</p>