The substr(s, i, l) function returns the sub string of s that starts at character number i (zero = first character), and is l characters long. Note that you can use negative numbers to start counting from the right e.g. -3 which means starting at the character 3 from the right. (Forgive me if I've miscounted any of the strings!)