Instant properties: upper

The instant property upper represents the upper case version of a string or character stored within a string or char operand.

Declaration

Form 1:

string string.upper

Form 2:

char char.upper

Discussion

The first version of the upper instant property is used in context of a string operand. The read access to this property results in a copy of the original string with lower case characters changed to the upper case notation. The original operand is not affected by the operation. This property is read-only. The write access to this property is not allowed. For example:

var string s = "Hello World!";

// Get the value of the upper property
var string result = s.upper; // result = "HELLO WORLD!"

// Modification is not allowed
s.upper = "OTHER TEXT";      // Chora compiler error

The second version of the upper instant property is used in context of a char operand. The read access to this property results in a copy of the original character modified from lower to the upper case notation. The original operand is not affected by the operation. This property is read-only. The write access to this property is not allowed. For example:

var char c = 'h';

// Get the value of the upper property
var char result = c.upper; // result = 'H'

// Modification is not allowed
c.upper = 'O';             // Chora compiler error

IMPORTANT

The current implementation of the upper instant property is limited to code points lying below 0x052F, which includes the UNICODE blocks: Basic Latin, Latin-1 Supplement, Latin-Extended-A, Latin-Extended-B, IPA Extensions, Greek and Coptic, Cyrillic, Cyrillic Supplement. Other characters are not guaranteed to be converted.