MAINSAIL Language Manual, Section 42.23

previous   next   top   contents   index   framed top   this page unframed


42.23. $nth

Figure 42–27. $nth
$ALWAYSINLINE
INTEGER
PROCEDURE   $nth        (STRING s;
                         
INTEGER n);

$nth returns the nth character of the STRING s, or -1 if s does not have an nth character. Character numbers in a STRING start at 1.

In other words, $nth(s,n) returns the same value as:

first(s[n FOR 1])

but is more convenient syntactically.


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 42.23