How do I get a list of all the printable characters in C#?

后端 未结 5 747
我寻月下人不归
我寻月下人不归 2020-12-18 19:10

I\'d like to be able to get a char array of all the printable characters in C#, does anybody know how to do this?

edit:

By printable I mean

5条回答
  •  孤城傲影
    2020-12-18 19:37

    I know ASCII wasn't specifically requested but this is a quick way to get a list of all the printable ASCII characters.

    for (Int32 i = 0x20; i <= 0x7e; i++)
    {
        printableChars.Add(Convert.ToChar(i));
    }
    

    See this ASCII table.

提交回复
热议问题