MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / padLeft

Method padLeft

source/core/StarString.cpp:779–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779String String::padLeft(size_t size, String const& filler) const {
780 if (!filler.length())
781 return *this;
782 String rs;
783 while (rs.length() + length() < size) {
784 rs.append(filler);
785 }
786 if (rs.length())
787 return rs + *this;
788 return *this;
789}
790
791String String::padRight(size_t size, String const& filler) const {
792 if (!filler.length())

Callers

nothing calls this directly

Calls 2

lengthMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected