File: Char.schelp

package info (click to toggle)
supercollider 1%3A3.7.0~repack-4%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 34,364 kB
  • sloc: cpp: 197,140; ansic: 72,013; lisp: 63,505; sh: 14,009; python: 1,992; perl: 766; makefile: 679; java: 677; xml: 326; yacc: 309; lex: 175; ruby: 173; objc: 65
file content (85 lines) | stat: -rw-r--r-- 1,860 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
class::Char
summary::ascii character
categories:: Core

description::
Chars may be written as literals using the $ sign. For example $a, $b, $c.
See link::Reference/Literals::

Chars may be created from link::Classes/Integer::s using the methods link::Classes/Integer#-asAscii:: and link::Classes/Integer#-asDigit::.

classmethods::

method::nl
Returns code::($\n)::
method::ff
Returns code::($\f)::
method::tab
Returns code::($\t)::
method::space
Returns code::($ )::
method::comma
Returns code::($\,)::
method::bullet
Returns a bullet character (•) in SuperCollider.app on OSX, but a simple asterix (*) on other frontends.
This method is not recommended, since it's actually not cross-platform.

instancemethods::
private:: archiveAsCompileString

subsection::conversion

method::ascii

returns:: the integer ascii value of a Char.

method::digit

returns:: an integer value from 0 to 9 for chars $0 to $9, and values 10 to 35 for chars $a to $z
or $A to $Z.

method::toUpper

returns:: the upper case version of a char. Nonalphabetic chars return themselves.

method::toLower

returns:: a lower case version of a char. Nonalphabetic chars return themselves.

subsection:: Testing

method::isAlpha

returns:: whether the char is an alphabetic character.

method::isAlphaNum

returns:: whether the char is an alphabetic or numeric character.

method::isPrint

returns:: whether the char is printable.

method::isPunct

returns:: whether the char is a punctuation character

method::isSpace

returns:: true if the char is white space.

method::isDecDigit

returns:: true if the char is a decimal digit $0 to $9.

method::isFileSafe

returns:: true if the char is safe for use as in a filename.
excludes the path separators / and :
discussion::
code::
 for(0,255,{ arg i;
	var a;
	[i,a = i.asAscii,a.isAlphaNum,a.isPrint,a.isPunct,a.isControl].postln;
});
::