Miscellaneous lemmas about strings #
@[simp]
theorem
String.leftpad_length
(n : ℕ)
(c : Char)
(s : String)
:
(String.leftpad n c s).length = max n s.length
The length of the String returned by String.leftpad n a c
is equal
to the larger of n
and s.length
theorem
String.leftpad_prefix
(n : ℕ)
(c : Char)
(s : String)
:
(String.replicate (n - s.length) c).IsPrefix (String.leftpad n c s)