Implementation: Computational constructsString operators (concatenation)

Programs use computational constructs such as loops and predefined functions to break programs up into sections. This makes programs more compact, easier to write and easier to maintain.

Part ofComputing ScienceSoftware design and development

String operators (concatenation)

It is often necessary to join text strings together in a program to make a new text string. This is called concatenation.

Here is an example of concatenation in reference language:

RECEIVE firstName FROM (STRING) KEYBOARD
RECEIVE surname FROM (STRING) KEYBOARD
SET displayName TO firstName & surname
SEND displayName TO DISPLAY

The user is asked to enter string values for the variables 'firstName' and 'surname'. These values are then concatenated (joined together using '&') and assigned as a single string value to the 'displayName' variable.