{"id":7059,"date":"2021-12-23T09:35:07","date_gmt":"2021-12-23T09:35:07","guid":{"rendered":"https:\/\/www.qec.tw\/?p=7059"},"modified":"2021-12-28T09:26:09","modified_gmt":"2021-12-28T09:26:09","slug":"characteranalysis","status":"publish","type":"post","link":"https:\/\/www.qec.tw\/ja\/86duino-reference\/characteranalysis\/","title":{"rendered":"Character Analysis"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">[Characters]<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">isAlphaNumeric(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is alphanumeric (a-z or A-Z or 0-9).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isAlpha(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is is alpha (a-z or A-Z).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isAscii(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is ASCII. (Visit the&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/ASCII\" target=\"_blank\" rel=\"noopener\">wiki<\/a>&nbsp;website to get the detail for ASCII character set)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isWhitespace(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is a white space (\u2018 \u2018 or \u2018\\t\u2019).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isControl(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is a control character. (Visit the&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Control_character\" target=\"_blank\" rel=\"noopener\">wiki<\/a>&nbsp;website to get detail for control character)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isDigit(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is a digit (0-9).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isGraph(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is a printable character (not including space character: \u2018 \u2018).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isLowerCase(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is a lower case character.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isPrintable(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is a printable character (including space character: \u2018 \u2018).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isPunct(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is punctuation character.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isSpace(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is a space character (\u2018 \u2018, \u2018\\f\u2019, \u2018\\n\u2019, \u2018\\r\u2019, \u2018\\t\u2019, \u2018\\v\u2019 characters).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isUpperCase(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is an upper case character.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">isHexadecimalDigit(thisChar)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Analyse if a char is a valid hexadecimal digit (0-9 and A-F).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>thisChar<\/code>: the char to be analysed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">True or false.<\/p>\n\n\n<hr \/>\n\n\n<h2 class=\"wp-block-heading\">Example Code<\/h2>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\/*\n  Character analysis operators\n \n Examples using the character analysis operators.\n Send any byte and the sketch will tell you about it.\n \n created 29 Nov 2010\n modified 2 Apr 2012\n by Tom Igoe\n \n This example code is in the public domain.\n *\/\n \nvoid setup() {\n  \/\/ Open serial communications and wait for port to open:\n  Serial.begin(9600);\n  while (!Serial) {\n    ; \/\/ wait for serial port to connect. Needed for native USB port only\n  }\n \n  \/\/ send an intro:\n  Serial.println(&quot;send any byte and I'll tell you everything I can about it&quot;);\n  Serial.println();\n}\n \nvoid loop() {\n  \/\/ get any incoming bytes:\n  if (Serial.available() &gt; 0) {\n    int thisChar = Serial.read();\n \n    \/\/ say what was sent:\n    Serial.print(&quot;You sent me: \\'&quot;);\n    Serial.write(thisChar);\n    Serial.print(&quot;\\'  ASCII Value: &quot;);\n    Serial.println(thisChar);\n \n    \/\/ analyze what was sent:\n    if (isAlphaNumeric(thisChar)) {\n      Serial.println(&quot;it's alphanumeric&quot;);\n    }\n    if (isAlpha(thisChar)) {\n      Serial.println(&quot;it's alphabetic&quot;);\n    }\n    if (isAscii(thisChar)) {\n      Serial.println(&quot;it's ASCII&quot;);\n    }\n    if (isWhitespace(thisChar)) {\n      Serial.println(&quot;it's whitespace&quot;);\n    }\n    if (isControl(thisChar)) {\n      Serial.println(&quot;it's a control character&quot;);\n    }\n    if (isDigit(thisChar)) {\n      Serial.println(&quot;it's a numeric digit&quot;);\n    }\n    if (isGraph(thisChar)) {\n      Serial.println(&quot;it's a printable character that's not whitespace&quot;);\n    }\n    if (isLowerCase(thisChar)) {\n      Serial.println(&quot;it's lower case&quot;);\n    }\n    if (isPrintable(thisChar)) {\n      Serial.println(&quot;it's printable&quot;);\n    }\n    if (isPunct(thisChar)) {\n      Serial.println(&quot;it's punctuation&quot;);\n    }\n    if (isSpace(thisChar)) {\n      Serial.println(&quot;it's a space character&quot;);\n    }\n    if (isUpperCase(thisChar)) {\n      Serial.println(&quot;it's upper case&quot;);\n    }\n    if (isHexadecimalDigit(thisChar)) {\n      Serial.println(&quot;it's a valid hexadecimaldigit (i.e. 0 - 9, a - F, or A - F)&quot;);\n    }\n \n    \/\/ add some space and ask for another byte:\n    Serial.println();\n    Serial.println(&quot;Give me another byte:&quot;);\n    Serial.println();\n  }\n}<\/pre><\/div>\n\n\n<hr \/>\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.qec.tw\/86duino\/86duino-language-reference\/\">Language Reference Home<\/a><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><em>The text of the 86Duino reference is a modification of&nbsp;<a href=\"http:\/\/arduino.cc\/en\/Reference\/HomePage\" target=\"_blank\" rel=\"noopener\">the Arduino reference<\/a>&nbsp;and is licensed under a&nbsp;<a href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/3.0\/\" target=\"_blank\" rel=\"noopener\">Creative Commons Attribution-ShareAlike 3.0 License<\/a>. Code samples in the reference are released into the public domain.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Characters] isAlphaNumeric(thisChar) Description Analyse if a char is alphanumeric (a-z or A-Z or 0-9). Parameters thisChar: the char to be analysed. Returns True or false. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7060,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[195],"tags":[162],"class_list":["post-7059","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-86duino-reference","tag-86duino"],"_links":{"self":[{"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/posts\/7059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/comments?post=7059"}],"version-history":[{"count":0,"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/posts\/7059\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/media\/7060"}],"wp:attachment":[{"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/media?parent=7059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/categories?post=7059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qec.tw\/ja\/wp-json\/wp\/v2\/tags?post=7059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}