code: public static String replace(String s, Map<String, Object> map) {
          StringBuilder ret = new StringBuilder((int) (s.length() * 1.5));
          int cursor = 0;
          for (int start, end; (start = s.indexOf("${", cursor)) != -1 && (end = s.indexOf("}", start)) != -1; ) {
              ret.append(s, cursor, start).append(map.get(s.substring(start + 2, end)));
              cursor = end + 1;
          }
          ret.append(s, cursor, s.length());
          return ret.toString();
      }
docs: Replace the pattern using a map, such as a pattern, such as A pattern is
  "hello ${foo}" and the map is {"foo" : "world"}, when you execute this
  function, the result is "hello world"
  
  @param s   The pattern string.
  @param map The key-value
  @return The string replaced.