code: public static boolean isPrintableString(String str) {
      for (int i = 0; i < str.length(); i++) {
        if (!isPrintableChar(str.charAt(i))) {
          return false;
        }
      }
      return true;
    }
docs: Determines whether the {@code String} contains only printable characters.
  
  @param str the {@code String} to be validated.
  @return whether the {@code String} contains only printable characters.