Cut the first characters up to position ``n'' out of string tuple.
tuple_str_first_n cuts the first characters up to position ``n'' out of each string of the input tuple T1 and returns them as new strings in the output tuple Substring (remark: the position within strings starts with 0 for the first character of a string). The number ``n'' is determined by the second input tuple T2. If T2 only contains one element, this element contains the number ``n''. If T1 and T2 have got the same number of elements, the first element of T2 determines the number ``n'' of characters to cut out of the first string of T1, the second element of T2 does so for the second string of T1 and so on. If T2 contains more than one element and T1 contains only one string, tuple_str_first_n cuts more than one substrings out of this string. The elements of T2 then determine the lengths of these substrings. If both input tuples contain more than one element but differ in the number of elements, tuple_str_first_n returns an error.
|
T1 (input_control) |
string(-array) -> string |
| Input tuple 1. | |
|
T2 (input_control) |
number(-array) -> integer / real |
| Input tuple 2. | |
|
Substring (output_control) |
string(-array) -> string |
| The first characters up to position ``n'' of each string. | |
tuple_str_first_n is reentrant and processed without parallelization.
tuple_str_last_n, tuple_strstr, tuple_strrstr, tuple_strlen, tuple_strchr, tuple_strrchr, tuple_split, tuple_environment
Operators not requiring licensing