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. The current implementation is limited to ASCII signs a-z. Please note, 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. The current implementation is limited to ASCII signs a-z. Please note, 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