Hello! I basically have a rule that a "code" should be 4 chars long. Always. BUT my backend sends me codes with leading 0 missing. So I need to add them back in myself.
If I encounter "1", then I pad with three leading zeroes. "0001"
If I encounter "22", then I pad with two leading zeroes. "0022"
If I encounter "333", then I pad with one leading zeroes. "0333"
I have an if statement that does that... but is there some sort of easy method in kotlin to "pad a string so that it always contains x characters, and pad it with y character?"