title: replace String with value of properties file in java
body: <p>I have a code to replace stream of string. I need to search a specific string that is defined in the key of properties file</p>
  
  <pre><code>    String result="";
          int i=0;
          while (i&lt;listToken.size()){
              result = listToken.get(i);
              while (enuKey.hasMoreElements()) {
                  String key = (String)enuKey.nextElement();
  //                String value = propertiesSlang.getProperty(key);
                  if (listToken.get(i).equals(key)){
                      String value = propertiesSlang.getProperty(key);
                      listToken.get(i).replace(listToken.get(i), value);
                      System.out.print("detected");
                  }
              }
              i++;
          }
  </code></pre>
  
  <p>But it doesn't replace word. How I can replace words using properties.</p>