string.sub (s, i [, j])sijijjstring.sub(s,1,j)sjstring.sub(s, -i)isi
If, after the translation of negative indices, i is less than 1, it is corrected to 1. If j is greater than the string length, it is corrected to that length. If, after these corrections, i is greater than j, the function returns the empty string.