Check out example codes for "add leading zeroes in c#". It will help you in understanding the concepts better.

Code Example 1

i.ToString().PadLeft(4, '0') - okay, but doesn't work for negative numbers
i.ToString("0000"); - explicit form
i.ToString("D4"); - short form format specifier
$"{i:0000}"; - string interpolation (C# 6.0+)

Learn ReactJs, React Native from akashmittal.com