This function returns a substring of the string variable str of length num starting at position pos. It returns the null string (i.e. a string of length zero) if pos is greater than the length of the string.