SuperCollider CLASSES

Char

ascii character
Inherits from: Magnitude : Object

Description

Chars may be written as literals using the $ sign. For example $a, $b, $c. See Literals

Chars may be created from Integers using the methods Integer: -asAscii and Integer: -asDigit.

Class Methods

*nl

Returns ($\n)

*ff

Returns ($\f)

*tab

Returns ($\t)

*space

Returns ($ )

*comma

Returns ($\,)

*bullet

Returns a bullet character (•) in SuperCollider.app on OSX, but a simple asterisk (*) on other frontends. This method is not recommended, since it's actually not cross-platform.

Inherited class methods

Undocumented class methods

*new

Instance Methods

conversion

-ascii

Returns:

the integer ascii value of a Char.

-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.

-toUpper

Returns:

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

-toLower

Returns:

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

Testing

-isAlpha

Returns:

whether the char is an alphabetic character.

-isAlphaNum

Returns:

whether the char is an alphabetic or numeric character.

-isPrint

Returns:

whether the char is printable.

-isPunct

Returns:

whether the char is a punctuation character

-isSpace

Returns:

true if the char is white space.

-isDecDigit

Returns:

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

-isFileSafe

Returns:

true if the char is safe for use as in a filename. excludes the path separators / and :

Discussion:

 for(0,255,{ arg i;
    var a;
    [i,a = i.asAscii,a.isAlphaNum,a.isPrint,a.isPunct,a.isControl].postln;
});

Inherited instance methods

Undocumented instance methods

-++ (that)

-< (aChar)

-== (aChar)

-asAscii

-asUnicode

-hash

-isControl

-isLower

-isPathSeparator

-isUpper

-isVowel