Oktatás * Programozás 2 * Szkriptnyelvek * levelezősök Félévek Linkek * kalendárium |
CSharp /
20180407aZero fill a string from leftIn Python: >>> "2".zfill(4) '0002' # fill with zeroes on the left, the width should be 4 >>> "123456789".zfill(4) '123456789' # never truncated In C#: csharp> "2".PadLeft(4, '0') "0002" // fill with zeroes on the left, the width should be 4 csharp> "123456789".PadLeft(4, '0') "123456789" // never truncated Of course, instead of |
Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |