Removing an old, cherished, yet pointless caveat "This documentation is
[supercollider.git] / Help / Core / Char.html
blob1dc884e46d3e64edbc3d26663e0ff878f967e898
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="824.42">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica; min-height: 22.0px}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
16 p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
17 span.s1 {text-decoration: underline}
18 span.s2 {font: 12.0px Helvetica}
19 span.Apple-tab-span {white-space:pre}
20 </style>
21 </head>
22 <body>
23 <p class="p1"><br></p>
24 <p class="p2"><b>Char<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>ascii characters</b></p>
25 <p class="p3"><br></p>
26 <p class="p4">Chars may be written as literals using the $ sign. For example $a, $b, $c.</p>
27 <p class="p4">See section [01 Literals]</p>
28 <p class="p3"><br></p>
29 <p class="p4">Chars may be created from Integers using the Integer methods asAscii and asDigit.</p>
30 <p class="p3"><br></p>
31 <p class="p5"><b><span class="s1">Conversion</span></b></p>
32 <p class="p3"><br></p>
33 <p class="p4"><b>ascii</b></p>
34 <p class="p3"><br></p>
35 <p class="p4">answers the integer ascii value of a Char.</p>
36 <p class="p3"><br></p>
37 <p class="p4"><b>digit</b></p>
38 <p class="p3"><br></p>
39 <p class="p4">answers an integer value from 0 to 9 for chars $0 to $9, and values 10 to 35 for chars $a to $z</p>
40 <p class="p4">or $A to $Z.</p>
41 <p class="p3"><br></p>
42 <p class="p4"><b>toUpper</b></p>
43 <p class="p3"><br></p>
44 <p class="p4">answers the upper case version of a char. Nonalphabetic chars return themselves.</p>
45 <p class="p3"><br></p>
46 <p class="p4"><b>toLower</b></p>
47 <p class="p3"><br></p>
48 <p class="p4">answers a lower case version of a char. Nonalphabetic chars return themselves.</p>
49 <p class="p3"><br></p>
50 <p class="p5"><b><span class="s1">Testing</span></b></p>
51 <p class="p3"><br></p>
52 <p class="p4"><b>isAlpha</b></p>
53 <p class="p3"><br></p>
54 <p class="p4">answers whether the char is an alphabetic character.</p>
55 <p class="p3"><br></p>
56 <p class="p4"><b>isAlphaNum</b></p>
57 <p class="p3"><br></p>
58 <p class="p4">answers whether the char is an alphabetic or numeric character.</p>
59 <p class="p3"><br></p>
60 <p class="p4"><b>isPrint</b></p>
61 <p class="p3"><br></p>
62 <p class="p4">answers whether the char is printable.</p>
63 <p class="p3"><br></p>
64 <p class="p4"><b>isPunct</b></p>
65 <p class="p3"><br></p>
66 <p class="p4">answers whether the char is a punctuation character</p>
67 <p class="p3"><br></p>
68 <p class="p4"><b>isSpace</b></p>
69 <p class="p3"><br></p>
70 <p class="p4">answers whether the char is white space.</p>
71 <p class="p3"><br></p>
72 <p class="p4"><span class="Apple-converted-space"> </span><b>isDecDigit</b></p>
73 <p class="p3"><span class="Apple-converted-space"> </span></p>
74 <p class="p4"><span class="Apple-converted-space"> </span>answers whether the char is a decimal digit $0 to $9.</p>
75 <p class="p3"><span class="Apple-converted-space"> </span></p>
76 <p class="p4"><span class="Apple-converted-space"> </span><b>isFileSafe</b></p>
77 <p class="p3"><span class="Apple-converted-space"> </span></p>
78 <p class="p4"><span class="Apple-converted-space"> </span>answers whether the char is safe for use as in a filename.</p>
79 <p class="p4"><span class="Apple-converted-space"> </span>excludes the path separators / and :<span class="Apple-converted-space"> </span></p>
80 <p class="p3"><span class="Apple-converted-space"> </span></p>
81 <p class="p3"><span class="Apple-converted-space"> </span></p>
82 <p class="p6"><span class="s2"><span class="Apple-converted-space"> </span></span>for(0,255,{ arg i;</p>
83 <p class="p6"><span class="Apple-tab-span"> </span>var a;</p>
84 <p class="p6"><span class="Apple-tab-span"> </span>[i,a = i.asAscii,a.isAlphaNum,a.isPrint,a.isPunct,a.isControl].postln;</p>
85 <p class="p6">});</p>
86 <p class="p7"><br></p>
87 <p class="p3"><br></p>
88 <p class="p3"><span class="Apple-converted-space"> </span></p>
89 </body>
90 </html>