title: Lastindexof() isn't working
body: <p>I have 2 lines of data in text file as example:
  Hello!   Morning
  Hi!   Evening</p>
  
  <p>I want only last word of a line. I used this code but instead of showing <strong>Evening</strong> it shows <strong>Hi! Evening</strong> where searchName is Hi!</p>
  
  <pre><code>try{
              BufferedReader in = new BufferedReader(fr);
  
              try {
                  while((s=in.readLine())!=null){
                      countline++;
                      String[] words=s.split(" ");
  
  
                      for(String word:words){
                          if(word.contains(searchName)){
                              System.out.println(words);
                              int lastSpace=word.lastIndexOf(" ");
                              String addres=word.substring(lastSpace+1,word.length());
  
                              System.out.println(addres);
  
                          }
                      }
                  }
                  in.close();
  
              } catch (IOException e) {
                  System.out.println("No address found for your name..We are updating");
              }
          }finally {
  
          }
  </code></pre>