public static void Main()
StringBuilder msgText = new StringBuilder();
StringBuilder msgText2 = new StringBuilder();
var userName = "Jeff Codes";
var email = "jeff.codes@email.com";
var phone = "800.555.1234";
var contactMethod = "email";
var oemPartNumber = "123";
msgText.AppendLine( normalizeRight(" Name", userName ) );
msgText.AppendLine( normalizeRight(" Email", email ) );
msgText.AppendLine( normalizeRight(" Phone", phone ) );
msgText.AppendLine( normalizeRight(" Contact Method", contactMethod ) );
msgText.AppendLine( normalizeRight(" Oem Part Code", oemPartNumber ) );
msgText2.AppendLine( normalizeLeft(" Name", userName ) );
msgText2.AppendLine( normalizeLeft(" Email", email ) );
msgText2.AppendLine( normalizeLeft(" Phone", phone ) );
msgText2.AppendLine( normalizeLeft(" Contact Method", contactMethod ) );
msgText2.AppendLine( normalizeLeft(" Oem Part Code", oemPartNumber ) );
Console.WriteLine(msgText.ToString());
Console.WriteLine(msgText2.ToString());
public static string normalizeRight(string label, string data)
StringBuilder sb = new StringBuilder();
string formatted = "{0}{1}";
string newData = String.Format( ": {0}", data );
return String.Format(formatted, label.PadRight(20, ' ') + ' ', newData);
public static string normalizeLeft(string label, string data)
StringBuilder sb = new StringBuilder();
string formatted = "{0}{1}";
string newData = String.Format( ": {0}", data );
return String.Format(formatted, label.PadLeft(20, ' ') + ' ', newData);