Vai al contenuto

Stringhe

Le stringhe sono manipolabili tramite le seguenti funzioni di sistema:STRCPY(strdst, strsrc); Copia da src a dstSTRCAT(strdst, strconcat); Prende dst e gli accoda concatvarint := STRLEN(str); Restituisce la lunghezza di strSTRNCPY(strdst, strsrc, nfirst, nlen); Estrae una sottostringa da src, a partire dal carattere numero nfirst (il primo carattere è lo zero) e di lunghezza nlen e la copia in dstvarint := STRCMP(str1, str2); Confronta due stringhe e restituisce: 0 se le stringhe sono uguali < 0 se str1 viene alfabeticamente dopo str2 (esempio: str1 = “def”, str2 = “abc”) > 0 se str1 viene alfabeticamente prima di str2 (esempio: str1 = “abc”, str2 = “def”)varint := STRSTR(str, substr, start); Cerca substr in str, a partire dal carattere numero start (il primo carattere è lo zero) e restituisce posizione trovata (-1 se la stringa non viene trovata)