Librerie standard
string
Questa libreria fornisce le funzioni generiche per lavorare sulle stringhe: ricerca ed estrazione di sottostringhe e corrispondenza di pattern. In Lua l'indicizzazione di una stringa parte da 1, non da 0 come in C. Gli indici possono essere negativi e in tal caso si contano a ritroso dalla fine: l'ultimo carattere è in posizione -1, e così via.
Mostra l'originale in inglese
This library provides generic functions for string manipulation, such as finding and extracting substrings, and pattern matching. When indexing a string in Lua, the first character is at position 1 (not at 0, as in C). Indices are allowed to be negative and are interpreted as indexing backwards, from the end of the string. Thus, the last character is at position -1, and so on.
19 propri
Funzioni 19
- byte Returns the internal numeric codes of the characters <code>s[start_pos], s[start_pos + 1], ..., s[end_pos]</code>
- char Receives zero or more integers. Returns a string with length equal to the number of arguments, in which each character has the internal numeric code equal to its corresponding argument
- dump Returns a string containing a binary representation (a *binary chunk*) of the given function.
- EndsWith Test whether this string ends with given string
- find Looks for the first match of <code>pattern</code> in the string.
- format Returns a formatted version of its variable number of arguments following the description given in its first argument.
- FormatArgs A better string.Format, replace <code>{num}</code> by the corresponding vararg in a string
- gmatch Returns an iterator function that, each time it is called, returns the next captures from <code>pattern</code> over the string s.
- gsub Returns a copy of s in which all (or the first <code>n</code>, if given) occurrences of the <code>pattern</code> have been replaced by a replacement string specified by <code>repl</code>.
- len Returns its length.
- lower Returns a copy of this string with all uppercase letters changed to lowercase.
- match Looks for the first match of <code>pattern</code> in the string.
- rep Returns a string that is the concatenation of <code>n</code> copies of the string <code>s</code> separated by the string <code>sep</code>.
- reverse Returns a string that is the string <code>s</code> reversed.
- StartsWith Test whether this string starts with given string
- sub Returns the substring of the string that starts at <code>i</code> and continues until <code>j</code>.
- ToTable Split string into table of single characters
- Trim Returns a new string with removed whitespace characters from the front and end of this string
- upper Returns a copy of this string with all lowercase letters changed to uppercase.