pad - How padding 2 variable on c#? -


this question has answer here:

  function zeropad(num, places){         var 0 = places - num.tostring().length + 1;         return array(+(zero > 0 && zero)).join("0") + num;     } 

please tell me means of code above, , how use on c#

the code javascript , pads number num zeros length places, example zeropad(12, 4) gives 0012. in c# can padleft() method, example 12.tostring().padleft(4, '0') gives same above 0012.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -