{"id":305,"date":"2024-10-04T10:18:08","date_gmt":"2024-10-04T09:18:08","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=305"},"modified":"2024-10-04T10:18:08","modified_gmt":"2024-10-04T09:18:08","slug":"mwnci-ord-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-ord-function\/","title":{"rendered":"Mwnci ord() Function"},"content":{"rendered":"<div id=\"bodyContent\" class=\"vector-body\">\n<div id=\"mw-content-text\" class=\"mw-body-content mw-content-ltr\" dir=\"ltr\" lang=\"en-GB\">\n<div class=\"mw-parser-output\">\n<h2><span id=\"Syntax\" class=\"mw-headline\">Syntax<\/span><\/h2>\n<p>ord(<i><b>character<\/b><\/i>)<\/p>\n<h2><span id=\"Description\" class=\"mw-headline\">Description<\/span><\/h2>\n<p>The <i>ord()<\/i> function returns the ASCII value of a given character.<\/p>\n<h2><span id=\"Example\" class=\"mw-headline\">Example<\/span><\/h2>\n<pre>line=\"0123456789This is a line\"\r\nprintln(\"Chr   Ascii value\")\r\nprintln(\"-----------------\")\r\nforeach n in line {\r\n    println(n, \"          \", ord(n))\r\n}\r\n\r\n\r\nChr   Ascii value\r\n-----------------\r\n0          48\r\n1          49\r\n2          50\r\n3          51\r\n4          52\r\n5          53\r\n6          54\r\n7          55\r\n8          56\r\n9          57\r\nT          84\r\nh          104\r\ni          105\r\ns          115\r\n           32\r\ni          105\r\ns          115\r\n           32\r\na          97\r\n           32\r\nl          108\r\ni          105\r\nn          110\r\ne          101\r\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Syntax ord(character) Description The ord() function returns the ASCII value of a given character. Example line=&#8221;0123456789This is a line&#8221; println(&#8220;Chr Ascii value&#8221;) println(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8220;) foreach n in line { println(n, &#8221; &#8220;, ord(n)) } Chr Ascii value &#8212;&#8212;&#8212;&#8212;&#8212;&#8211; 0 48 1 49 2 50 3 51 4 52 5 53 6 54 7 55 8 56 &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-ord-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci ord() Function&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-305","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=305"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/305\/revisions"}],"predecessor-version":[{"id":306,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/305\/revisions\/306"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}