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 -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

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