>FromYourCode();

Source code quote in C#269

  4 June, 2016 at 01:30
        public string PrependZeroes(int stringLength, string str)
        {
            var sb = new StringBuilder();
            for (var ix = 0; ix < stringLength; ix++)
            {
                sb.Append("0");
            }
            sb.Append(str);
            var startIx = sb.Length - stringLength;
            if (startIx < 0)
                startIx = 0;
            return sb.ToString().Substring(startIx, stringLength);
        }

Check similar quotes

Share this quote