code: public static String dup(char c, int num) {
          if (c == 0 || num < 1)
              return "";
          StringBuilder sb = new StringBuilder(num);
          for (int i = 0; i < num; i++)
              sb.append(c);
          return sb.toString();
      }
docs: Copy characters
  
  @param c   characters
  @param num character number
  @return new characters