vl-string-elt


(vl-string-elt string index)

This function returns the integer value for the character at the index position in string.

Arguments

string  (string) the string to return the indexed character value
index  (integer)  the index for the character; 0 is the index of the first character

Return

(integer) the integer value for the specified character

Example

(vl-string-elt " abc" 0)  32
(vl-string-elt "abc" 2)  99

Remarks

if index is outside the string length, an error is triggered;

in BricsCAD, each character in a string is represented by its Unicode value; therefore, forward and backward conversion between visual representation (the character) and its numerical representation (the Unicode value) is always constant across all platforms and versions, local code pages have no impact;
additionally, there is always a 1-to-1 relation (length of a string is identical to number of characters, and number of Unicode values);
this is different from AutoCAD AutoLISP, where all these conditions are not ensured, and therefore the backward + forward conversion is rather useless, and also depends on local code pages;

see (vl-list->string) function



©  Bricsys NV. All rights reserved.