using System;
public class Program
{
public static void Main()
Console.WriteLine(StrReplaceStar("王大頭"));
}
/// <summary>
/// 字串中間替換星號隱密顯示
/// </summary>
/// <param name="before">原始字串</param>
/// <returns></returns>
public static string StrReplaceStar(string before)
string result="";
int i = 0;
string star = "";
i = before.Length / 2;
if(i==0){return before;}
for(int j=1;j<=i;j++)
star+="*";
int flow = 0;
if (i != 1) { flow = 1; }
result = before.Substring(0, i - flow) + star + before.Substring(i + star.Length - flow);
return result;