Character.isSpaceChar(c)
时间: 2024-06-03 07:06:50 浏览: 15
This method is a static method of the Character class in Java. It takes a single argument, c, which is a character, and returns a boolean value indicating whether the character is a space character or not.
A space character is defined as any character that is considered whitespace, including the space character (' '), tab character ('\t'), line feed character ('\n'), carriage return character ('\r'), form feed character ('\f'), and vertical tab character ('\u000B').
The method returns true if the character is a space character, and false otherwise.
Example usage:
char c = ' ';
boolean isSpace = Character.isSpaceChar(c); // isSpace is true
c = '\t';
isSpace = Character.isSpaceChar(c); // isSpace is true
c = 'a';
isSpace = Character.isSpaceChar(c); // isSpace is false
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)