Vai al contenuto

Strings

Strings can be managed with the following system functions:STRCPY(strdst, strsrc); Copies from strsrc to strdstSTRCAT(strdst, strconcat); Takes strdst and queues strconcatvarint := STRLEN(str); Returns length of strSTRNCPY(strdst, strsrc, nfirst, nlen); Extracts a substring from strsrc starting from character number nfirst (first character is zero) and length nlen and copies it to strdstvarint := STRCMP(str1, str2); Compares two strings and returns: 0 if the strings are equal < 0 if str1 comes alphabetically after str2 (example: str1 = “def”, str2 = “abc”) > 0 if str1 comes alphabetically before str2 (example: str1 = “abc”, str2 = “def”)varint := STRSTR(str, substr, start); Seeks substr inside str starting from character number start (first character is zero) and returns position found (-1 if string is not found)