Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[BUG] isWhitespace() / isSpace() #7041

Closed
arduino/reference-en
#595
Labels
Component: CoreRelated to the code for the standard Arduino API Type: Bug
@171231

Description

Good Morning facchinm
Issue #7039 not a BUG?
Fail!

the isWhitespace() function bring Char 9円 (TAB) and 32円 (SPACE) as true
the isSpace() bring 9円 10円 11円 12円 13円 32円 as true

the ctype.h have isBlank() function,
Implementation?
Highligth isBlank() NONE / but isBlank() gives 9円 and 32円 as true

Also repair:
Arduino isWhitespace() -> ctype isspace()
Ardunio isSpace() -> ctype isblank()

facchinm
This issue tracker is only to be used to report bugs or feature requests. This topic is more appropriate for the Arduino Forum. I'm sure we'll be able to help you with your problem over there.

in https://www.arduino.cc/reference/en/language/functions/characters/isspace/
isSpace() true by ASCII 9 and 32 (DEC).
in https://www.arduino.cc/reference/en/language/functions/characters/iswhitespace/
isWhitespace() true then ASCII-Code 9, 10, 11, 12, 13 and 32 (DEC)

void setup()
{
 Serial.begin(9600); // Serial Init
 while (!Serial); // Wartet auf seriellen Monitor
}
void loop() 
{
 for (int thisChar = 0; thisChar < 128; thisChar++)
 {
 Serial.print("Char: \'");
 Serial.write(thisChar);
 Serial.print("\' ASCII: ");
 Serial.print(thisChar);
 Serial.print(" ");
 if (isSpace(thisChar)) { Serial.print(", isSpace()"); }
 if (isWhitespace(thisChar)) { Serial.print(", isWhitespace()"); }
 Serial.println(".");
 }
 while(1);
}

This Code maen: isSpace(thisChar); is true by 9, 10,11, 12 13 32 (DEC) and maen isWhitespace(thisChar) is true by 9 and 32 (DEC)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreRelated to the code for the standard Arduino API Type: Bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /