public static void Main()
string a = "Ferad Hasanov Zyulkyarov";
string a2 = AnonymizeNames(a);
string b2 = AnonymizeId(b);
protected static string AnonymizeNames(string fullName)
int nonAnonymizedLength = 14;
if (fullName.Length <= nonAnonymizedLength)
result = fullName.Substring(0, nonAnonymizedLength);
int numAsterix = fullName.Length - nonAnonymizedLength;
string asterixs = new string('*', numAsterix);
protected static string AnonymizeId(string id)
int nonAnonymizedLength = 5;
if (id.Length <= nonAnonymizedLength + 1)
result = id.Substring(0, nonAnonymizedLength);
char lastCharacter = id[id.Length - 1];
int numAsterix = id.Length - nonAnonymizedLength - 1;
string asterixs = new string('*', numAsterix);
result += asterixs + lastCharacter;