How can I zero pad a 4 character string in C#
<p>I am using the following class method to create a Base36 string from a number:</p>

<pre><code>private const string CharList = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

public static String Encode(long input) {
    if (input &lt; 0) throw new ArgumentOutOfRangeException("input", input, "input cannot be negative");
        char[] clistarr = CharList.ToCharArray();
        var result = new Stack&lt;char&gt;();
        while (input != 0)
        {
            result.Push(clistarr[input % 36]);
            input /= 36;
        }
        return new string(result.ToArray());
    }
</code></pre>

<p>One of the requirements is that the string should always be padded with zero's and should be a maximum of four digits. Can anyone suggest a way that I can code the leading zero's and also limit the function so it will never return more than "ZZZZ" ? Is there some function in C# that can do this. Sorry about the indentation on this code. I am not sure why it's not indenting properly.  </p>
