Skip to content

Swap and correct the documentation of isSpace() and isWhitespace() #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Language/Functions/Characters/isSpace.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ subCategories: [ "Characters" ]

[float]
=== Description
Analyse if a char is the space character. Returns true if thisChar contains the space character.
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'`).
[%hardbreaks]


Expand All @@ -34,7 +34,7 @@ isSpace(thisChar)

[float]
=== Returns
`true`: if thisChar is a space.
`true`: if thisChar is a white-space character.

--
// OVERVIEW SECTION ENDS
Expand All @@ -50,11 +50,11 @@ isSpace(thisChar)

[source,arduino]
----
if (isSpace(myChar)) { // tests if myChar is the space character
Serial.println("The character is a space");
if (isSpace(myChar)) { // tests if myChar is a white-space character
Serial.println("The character is white-space");
}
else {
Serial.println("The character is not a space");
Serial.println("The character is not white-space");
}
----

Expand Down
11 changes: 5 additions & 6 deletions Language/Functions/Characters/isWhitespace.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ subCategories: [ "Characters" ]

[float]
=== Description
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')).
Returns true if thisChar contains a white space.
Analyse if a char is a space character. Returns true if the argument is a space or horizontal tab (`'\t'`).
[%hardbreaks]


Expand All @@ -34,7 +33,7 @@ isWhitespace(thisChar)

[float]
=== Returns
`true`: if thisChar is a white space.
`true`: if thisChar is a space character.

--
// OVERVIEW SECTION ENDS
Expand All @@ -50,11 +49,11 @@ isWhitespace(thisChar)

[source,arduino]
----
if (isWhitespace(myChar)) { // tests if myChar is a white space
Serial.println("The character is a white space");
if (isWhitespace(myChar)) { // tests if myChar is a space character
Serial.println("The character is a space or tab");
}
else {
Serial.println("The character is not a white space");
Serial.println("The character is not a space or tab");
}
----

Expand Down