Various code fragments relating to manipulation of arrays and strings