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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -