c#中有空格吗?

use*_*494 -1 c# whitespace

我在想有没有办法检查参数是否包含空格,水平,垂直制表符,换页,回车或换行符等字符.有点像isspace但在c#中.那可能吗?

phi*_*lip 5

只是看下Char,你会找到你的答案.

在此输入图像描述


Moo*_*ice 5

Char.IsWhiteSpace是为此目的而设计的.例如,我在解析字符串之前使用过它,例如:

public int EatWhitespace(string input, int pos)
{
    while(Char.IsWhiteSpace(input[pos])
        ++pos;
    return pos;
}
Run Code Online (Sandbox Code Playgroud)