Is there a better way to format this string?
var Mac = sdr.GetString(0);
string trimMac = Mac.Replace("-", "");
string formatMac = trimMac.Insert(4, ".");
string formatAgain = formatMac.Insert(9, ".");
string dudeWTF = formatAgain.Trim();
Please help.
Pravesh Singh
12-Dec-2013Why do something simple, when you can use a...
REGULAR EXPRESSION
The expression above creates a capture group for each set of characters separated by a hyphen "-", then constructs the output string using the contents of those capture groups.