This site is supported by donations to The OEIS Foundation.
Template:Char/doc
From OeisWiki
The {{char}} OEIS Wiki utility template returns the character corresponding to the given ASCII code.
Usage
- {{char|an integer from 0 to 127}}
Valid input
- An integer from 0 to 127 as argument.
ASCII Table
Each item is separated by a space followed by a horizontal tab (see code below.)
<!-- Char -->NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI <!-- DEC -->00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 <!-- Char -->DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US <!-- DEC -->16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 <!-- Char -->SP ! " # $ % & ' ( ) * + , - . / <!-- DEC -->32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 <!-- Char -->0 1 2 3 4 5 6 7 8 9 : ; < = > ? <!-- DEC -->48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 <!-- Char -->@ A B C D E F G H I J K L M N O <!-- DEC -->64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 <!-- Char -->P Q R S T U V W X Y Z [ \ ] ^ _ <!-- DEC -->80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 <!-- Char -->` a b c d e f g h i j k l m n o <!-- DEC -->96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 <!-- Char -->p q r s t u v w x y z { | } ~ DEL <!-- DEC -->112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
Examples
Examples with valid input
Code Result Code Result Comment {{ASCII|NUL}} 0 {{char|0}} NUL {{ASCII|SOH}} 1 {{char|1}} SOH {{ASCII|STX}} 2 {{char|2}} STX {{ASCII|ETX}} 3 {{char|3}} ETX {{ASCII|EOT}} 4 {{char|4}} EOT {{ASCII|ENQ}} 5 {{char|5}} ENQ {{ASCII|ACK}} 6 {{char|6}} ACK {{ASCII|BEL}} 7 {{char|7}} BEL {{ASCII|BS}} 8 {{char|8}} BS {{ASCII|HT}} 9 {{char|9}} HT {{ASCII|LF}} 10 {{char|10}} LF {{ASCII|VT}} 11 {{char|11}} VT {{ASCII|FF}} 12 {{char|12}} FF {{ASCII|CR}} 13 {{char|13}} CR {{ASCII|SO}} 14 {{char|14}} SO {{ASCII|SI}} 15 {{char|15}} SI {{ASCII|DLE}} 16 {{char|16}} DLE {{ASCII|DC1}} 17 {{char|17}} DC1 {{ASCII|DC2}} 18 {{char|18}} DC2 {{ASCII|DC3}} 19 {{char|19}} DC3 {{ASCII|DC4}} 20 {{char|20}} DC4 {{ASCII|NAK}} 21 {{char|21}} NAK {{ASCII|SYN}} 22 {{char|22}} SYN {{ASCII|ETB}} 23 {{char|23}} ETB {{ASCII|CAN}} 24 {{char|24}} CAN {{ASCII|EM}} 25 {{char|25}} EM {{ASCII|SUB}} 26 {{char|26}} SUB {{ASCII|ESC}} 27 {{char|27}} ESC {{ASCII|FS}} 28 {{char|28}} FS {{ASCII|GS}} 29 {{char|29}} GS {{ASCII|RS}} 30 {{char|30}} RS {{ASCII|US}} 31 {{char|31}} US {{ASCII| }} 32 {{char|{{ASCII| }}}} (empty parameter,
leading and trailing spaces
are always trimmed out){{ASCII|}} 32 {{char|{{ASCII|}}}} (empty parameter) {{ASCII}} 32 {{char|{{ASCII}}}} (no parameter) {{ASCII|!}} 33 {{char|33}} ! {{ASCII|"}} 34 {{char|34}} " {{ASCII|#}} 35 {{char|35}} # {{ASCII|$}} 36 {{char|36}} $ {{ASCII|%}} 37 {{char|37}} % {{ASCII|&}} 38 {{char|38}} & {{ASCII|'}} 39 {{char|39}} ' {{ASCII|(}} 40 {{char|40}} ( {{ASCII|)}} 41 {{char|41}} ) {{ASCII|*}} 42 {{char|42}} * {{ASCII|+}} 43 {{char|43}} + {{ASCII|,}} 44 {{char|44}} , {{ASCII|-}} 45 {{char|45}} - {{ASCII|.}} 46 {{char|46}} . {{ASCII|/}} 47 {{char|47}} / {{ASCII|0}} 48 {{char|48}} 0 {{ASCII|1}} 49 {{char|49}} 1 {{ASCII|2}} 50 {{char|50}} 2 {{ASCII|3}} 51 {{char|51}} 3 {{ASCII|4}} 52 {{char|52}} 4 {{ASCII|5}} 53 {{char|53}} 5 {{ASCII|6}} 54 {{char|54}} 6 {{ASCII|7}} 55 {{char|55}} 7 {{ASCII|8}} 56 {{char|56}} 8 {{ASCII|9}} 57 {{char|57}} 9 {{ASCII|:}} 58 {{char|58}} : {{ASCII|;}} 59 {{char|59}} ; {{ASCII|<}} 60 {{char|60}} < {{ASCII|=}} 32 {{char|{{ASCII|=}}}} (empty parameter,
= is name/value separator
of template parameter){{ASCII|{{=}}}} 61 {{char|{{ASCII|{{=}}}}}} = (Cf. {{=}} giving =) {{ASCII|>}} 62 {{char|62}} > {{ASCII|?}} 63 {{char|63}} ? {{ASCII|@}} 64 {{char|64}} @ {{ASCII|A}} 65 {{char|65}} A {{ASCII|B}} 66 {{char|66}} B {{ASCII|C}} 67 {{char|67}} C {{ASCII|D}} 68 {{char|68}} D {{ASCII|E}} 69 {{char|69}} E {{ASCII|F}} 70 {{char|70}} F {{ASCII|G}} 71 {{char|71}} G {{ASCII|H}} 72 {{char|72}} H {{ASCII|I}} 73 {{char|73}} I {{ASCII|J}} 74 {{char|74}} J {{ASCII|K}} 75 {{char|75}} K {{ASCII|L}} 76 {{char|76}} L {{ASCII|M}} 77 {{char|77}} M {{ASCII|N}} 78 {{char|78}} N {{ASCII|O}} 79 {{char|79}} O {{ASCII|P}} 80 {{char|80}} P {{ASCII|Q}} 81 {{char|81}} Q {{ASCII|R}} 82 {{char|82}} R {{ASCII|S}} 83 {{char|83}} S {{ASCII|T}} 84 {{char|84}} T {{ASCII|U}} 85 {{char|85}} U {{ASCII|V}} 86 {{char|86}} V {{ASCII|W}} 87 {{char|87}} W {{ASCII|X}} 88 {{char|88}} X {{ASCII|Y}} 89 {{char|89}} Y {{ASCII|Z}} 90 {{char|90}} Z {{ASCII|[}} 91 {{char|91}} [ {{ASCII|\}} 92 {{char|92}} \ {{ASCII|]}} 93 {{char|93}} ] {{ASCII|^}} 94 {{char|94}} ^ {{ASCII|_}} 95 {{char|95}} _ {{ASCII|`}} 96 {{char|96}} ` {{ASCII|a}} 97 {{char|97}} a {{ASCII|b}} 98 {{char|98}} b {{ASCII|c}} 99 {{char|99}} c {{ASCII|d}} 100 {{char|100}} d {{ASCII|e}} 101 {{char|101}} e {{ASCII|f}} 102 {{char|102}} f {{ASCII|g}} 103 {{char|103}} g {{ASCII|h}} 104 {{char|104}} h {{ASCII|i}} 105 {{char|105}} i {{ASCII|j}} 106 {{char|106}} j {{ASCII|k}} 107 {{char|107}} k {{ASCII|l}} 108 {{char|108}} l {{ASCII|m}} 109 {{char|109}} m {{ASCII|n}} 110 {{char|110}} n {{ASCII|o}} 111 {{char|111}} o {{ASCII|p}} 112 {{char|112}} p {{ASCII|q}} 113 {{char|113}} q {{ASCII|r}} 114 {{char|114}} r {{ASCII|s}} 115 {{char|115}} s {{ASCII|t}} 116 {{char|116}} t {{ASCII|u}} 117 {{char|117}} u {{ASCII|v}} 118 {{char|118}} v {{ASCII|w}} 119 {{char|119}} w {{ASCII|x}} 120 {{char|120}} x {{ASCII|y}} 121 {{char|121}} y {{ASCII|z}} 122 {{char|122}} z {{ASCII|{}} 123 {{char|123}} { {{ASCII||}} 32 {{char|{{ASCII||}}}} (2 empty parameters,
| is parameters separator){{ASCII|{{!}}}} 124 {{char|{{ASCII|{{!}}}}}} | (Cf. {{!}} giving |) {{ASCII|}}} 32} {{char|{{ASCII|}}}}} } (empty parameter, gotcha!) {{ASCII|} }} 125 {{char|{{ASCII|} }}}} } (space needed after }, i.e. } ) {{ASCII|~}} 126 {{char|126}} ~ {{ASCII|DEL}} 127 {{char|127}} DEL
Examples with invalid input (returns an error message)
Code Result {{char|-1}} Char error: Argument must be an integer in [0..127] {{char|128}} Char error: Argument must be an integer in [0..127] {{char|3.14}} Char error: Argument must be an integer in [0..127] {{char|a}} Char error: Argument must be an integer in [0..127]
Code
<noinclude>{{documentation}}</noinclude><includeonly><!-- <!== Each item is separated by a space followed by a horizontal tab (for nice alignment, but not recognized by #explode:) Char ==>NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI <!== DEC ==>00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 <!== Char ==>DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US <!== DEC ==>16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 <!== Char ==> ! " # $ % & ' ( ) * + , - . / <!== DEC ==>32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 <!== Char ==>0 1 2 3 4 5 6 7 8 9 : ; < = > ? <!== DEC ==>48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 <!== Char ==>@ A B C D E F G H I J K L M N O <!== DEC ==>64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 <!== Char ==>P Q R S T U V W X Y Z [ \ ] ^ _ <!== DEC ==>80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 <!== Char ==>` a b c d e f g h i j k l m n o <!== DEC ==>96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 <!== Char ==>p q r s t u v w x y z { | } ~ DEL <!== DEC ==>112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 --><!-- Special characters for MediaWiki server: # is used for numbered lists, and also as separator between pagename and anchorname. * is used for bulleted lists. : is used as separator between namespace and pagename, e.g. Template:Name, and also as separator between attribute name and attribute value. ; is used as separator between attributes. = is used as separator between template parameter name and parameter value. | is used as separator between template parameters, and also as separator between wikitable columns. -->{{#switch: {{#if: {{{1|}}} | {{{1}}} | NAN }} | 0 = NUL | 1 = SOH | 2 = STX | 3 = ETX | 4 = EOT | 5 = ENQ | 6 = ACK | 7 = BEL | 8 = BS | 9 = HT | 10 = LF | 11 = VT | 12 = FF | 13 = CR | 14 = SO | 15 = SI | 16 = DLE | 17 = DC1 | 18 = DC2 | 19 = DC3 | 20 = DC4 | 21 = NAK | 22 = SYN | 23 = ETB | 24 = CAN | 25 = EM | 26 = SUB | 27 = ESC | 28 = FS | 29 = GS | 30 = RS | 31 = US | 32 = | 33 = ! | 34 = " | 35 =#| 36 = $ | 37 = % | 38 = & | 39 = ' | 40 = ( | 41 = ) | 42 =*| 43 = + | 44 = , | 45 = - | 46 = . | 47 = / | 48 = 0 | 49 = 1 | 50 = 2 | 51 = 3 | 52 = 4 | 53 = 5 | 54 = 6 | 55 = 7 | 56 = 8 | 57 = 9 | 58 =:| 59 =;| 60 = < | 61 ={{=}}| 62 = > | 63 = ? | 64 = @ | 65 = A | 66 = B | 67 = C | 68 = D | 69 = E | 70 = F | 71 = G | 72 = H | 73 = I | 74 = J | 75 = K | 76 = L | 77 = M | 78 = N | 79 = O | 80 = P | 81 = Q | 82 = R | 83 = S | 84 = T | 85 = U | 86 = V | 87 = W | 88 = X | 89 = Y | 90 = Z | 91 = [ | 92 = \ | 93 = ] | 94 = ^ | 95 = _ | 96 = ` | 97 = a | 98 = b | 99 = c | 100 = d | 101 = e | 102 = f | 103 = g | 104 = h | 105 = i | 106 = j | 107 = k | 108 = l | 109 = m | 110 = n | 111 = o | 112 = p | 113 = q | 114 = r | 115 = s | 116 = t | 117 = u | 118 = v | 119 = w | 120 = x | 121 = y | 122 = z | 123 = { | 124=|| 125 = } | 126 = ~ | 127 = DEL | {{error| Char error: Argument must be an integer in [0..127] }} }}</includeonly>
See also
- {{ASCII}} (template to get the ASCII code corresponding to an ASCII character)