2. SUBSTRINGS
• A substring is a string of characters that are contained within another
string. For example:
• ‘Bits’ is a substring of the string ‘Bits and bytes’
• ‘Bytes is a substring of the string ‘Bits and bytes’
• ‘its and by’ is a substring of the string ‘Bits and bytes’
4. EXAMPLE
A program is required to generate a customer code. It will ask for the
customer forename, surname and their year of birth.
The program will then create a 6 digit customer code using:
• First 2 letters of forename
• Last 2 digits of year of birth
• First 2 letters of surname
john smith 1995 would have the customer code: jo95sm