Extract a substring from a string
String_Type substr (String_Type s, Integer_Type n, Integer_Type len)
The substr function returns a substring with length len
of the string s beginning at position n. If len is
-1, the entire length of the string s will be used for
len. The first character of s is given by n equal
to 1.
substr ("To be or not to be", 7, 5);
returns "or no"
In many cases it is more convenient to use array indexing rather
than the substr function. In fact, substr(s,i+1,strlen(s)) is
equivalent to s[[i:]].
- slangrtl
-
array_map,
bstrlen,
extract_element,
getenv,
init_char_array,
is_list_element,
is_substr,
length,
strlen,
strncmp,
strreplace,
strsub,
time
|