code: public static String replicate(String s, int times) {
          if (s==null) return null;
          if (times <= 0 || s.length() == 0) return "";
  
          StringBuilder b = new StringBuilder(s.length() * times);
          for (int k = 1; k <= times; ++k) b.append(s);
          return b.toString();
      }
docs: Replicates a string.
  @param s         the string to replicate
  @param times     number of times
  @return combined string