public static String LeadZero(String value, Int32 length) { StringBuilder lResult = new StringBuilder(); length -= value.Length; while (length > 0) { lResult.Append('0'); length--; } lResult.Append(value); return lResult.ToString(); }