public static void Main()
string vstup = "SKNT8S03-8DKK9E35";
string vystup = Preformatuj(vstup);
Console.WriteLine(vystup);
Console.WriteLine(TestPreformatovani(vystup));
public static string Preformatuj(string vstup)
return "SKNT-8S03-8DKK-9E35";
public static bool TestPreformatovani(string vystup)
if(string.IsNullOrEmpty(vystup) || vystup.Length != 19)
for(int i = 0; i < vystup.Length; i++)
if((i+1) % 5 == 0 && vystup[i] != '-')
else if((i+1) % 5 != 0 && vystup[i] == '-')
else if((!char.IsLetterOrDigit(vystup[i]) || char.IsLower(vystup[i])) && vystup[i] != '-')