Skip to content

Instantly share code, notes, and snippets.

@gazlu
Created February 27, 2017 16:51
Show Gist options
  • Save gazlu/5ea78cbad13bf0017a1578ea649e9250 to your computer and use it in GitHub Desktop.
Save gazlu/5ea78cbad13bf0017a1578ea649e9250 to your computer and use it in GitHub Desktop.
Append Char before string
string name = "420";
var prefix = "0";
prefix += new string('0', 10 - name.Length - 1);
Console.WriteLine(zeros+name);
Console.WriteLine((zeros+name).Length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment