static void Main(string[] args)
{
Console.WriteLine(GetAsciiTable(128));
Console.ReadLine();
}
public static string GetAsciiTable(int totalChar)
{
return GetAsciiTable(totalChar, 0, totalChar, " ");
}
public static string GetAsciiTable(int totalChar, int startChar)
{
return GetAsciiTable(totalChar, startChar, totalChar, " ");
}
public static string GetAsciiTable(int totalChar, int startChar, int charCountPerRow)
{
return GetAsciiTable(totalChar, startChar, charCountPerRow, " ");
}
public static string GetAsciiTable(int totalChar, int startChar, int charCountPerRow, string seperator)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < totalChar; i++)
{
sb.AppendFormat("{0}{1}", (char)(i + startChar), ((i + 1) % charCountPerRow == 0 && i > 0) ? "\r\n" : seperator);
}
return sb.ToString();
}
Hiç yorum yok:
Yorum Gönder