Exemple #1
0
String StringUtil::Pad(const String& input, int final_length,
                       const String& pad_string /* = " " */,
                       PadType type /* = PadType::Right */) {
  int len = input.size();
  return string_pad(input.data(), len, final_length, pad_string.data(),
                    pad_string.size(), static_cast<int>(type));
}
Exemple #2
0
String StringUtil::Pad(CStrRef input, int final_length,
                       CStrRef pad_string /* = " " */,
                       PadType type /* = PadRight */) {
  int len = input.size();
  char *ret = string_pad(input.data(), len, final_length, pad_string.data(),
                         pad_string.size(), type);
  return String(ret, len, AttachString);
}