Skip to content

Commit 8370cea

Browse files
authored
Merge pull request #595 from per1234/swap-isspace-iswhitespace-documentation
Swap and correct the documentation of isSpace() and isWhitespace()
2 parents 36cfe0e + 2378d87 commit 8370cea

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

Language/Functions/Characters/isSpace.adoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ subCategories: [ "Characters" ]
1717

1818
[float]
1919
=== Description
20-
Analyse if a char is the space character. Returns true if thisChar contains the space character.
20+
Analyse if a char is a white-space character. Returns true if the argument is a space, form feed (`'\f'`), newline (`'\n'`), carriage return (`'\r'`), horizontal tab (`'\t'`), or vertical tab (`'\v'`).
2121
[%hardbreaks]
2222

2323

@@ -33,7 +33,7 @@ Analyse if a char is the space character. Returns true if thisChar contains the
3333

3434
[float]
3535
=== Returns
36-
`true`: if thisChar is a space.
36+
`true`: if thisChar is a white-space character.
3737

3838
--
3939
// OVERVIEW SECTION ENDS
@@ -49,11 +49,11 @@ Analyse if a char is the space character. Returns true if thisChar contains the
4949

5050
[source,arduino]
5151
----
52-
if (isSpace(myChar)) { // tests if myChar is the space character
53-
Serial.println("The character is a space");
52+
if (isSpace(myChar)) { // tests if myChar is a white-space character
53+
Serial.println("The character is white-space");
5454
}
5555
else {
56-
Serial.println("The character is not a space");
56+
Serial.println("The character is not white-space");
5757
}
5858
----
5959

Language/Functions/Characters/isWhitespace.adoc

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ subCategories: [ "Characters" ]
1717

1818
[float]
1919
=== Description
20-
Analyse if a char is a white space, that is space, formfeed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v')).
21-
Returns true if thisChar contains a white space.
20+
Analyse if a char is a space character. Returns true if the argument is a space or horizontal tab (`'\t'`).
2221
[%hardbreaks]
2322

2423

@@ -34,7 +33,7 @@ Returns true if thisChar contains a white space.
3433

3534
[float]
3635
=== Returns
37-
`true`: if thisChar is a white space.
36+
`true`: if thisChar is a space character.
3837

3938
--
4039
// OVERVIEW SECTION ENDS
@@ -50,11 +49,11 @@ Returns true if thisChar contains a white space.
5049

5150
[source,arduino]
5251
----
53-
if (isWhitespace(myChar)) { // tests if myChar is a white space
54-
Serial.println("The character is a white space");
52+
if (isWhitespace(myChar)) { // tests if myChar is a space character
53+
Serial.println("The character is a space or tab");
5554
}
5655
else {
57-
Serial.println("The character is not a white space");
56+
Serial.println("The character is not a space or tab");
5857
}
5958
----
6059

0 commit comments

Comments
 (0)