MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / lpad

Method lpad

core/string/ustring.cpp:5456–5463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5454}
5455
5456String String::lpad(int min_length, const String &character) const {
5457 String s = *this;
5458 int padding = min_length - s.length();
5459 if (padding > 0) {
5460 s = character.repeat(padding) + s;
5461 }
5462 return s;
5463}
5464
5465String String::sprintf(const Array &values, bool *error) const {
5466 static const String ZERO("0");

Callers 5

sprintfMethod · 0.80
_line_col_changedMethod · 0.80
_get_klidMethod · 0.80
test_string.hFile · 0.80

Calls 2

repeatMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected