String operations

GS undefined

Character strings can be supposed to various operations. These operations are in fact functions that are included in the Borland dialect. They're found both in Borland Pascal and Free Pascal.

Str and Val
The str and the val function convert a number into a string and back.

STR
The str function converts a number (usually integer) into a character string. For example:

VAL
The val function converts a string into a number only if the string doesn't contain non-numeric characters,otherwise the number turns to zero (tested with Bloodshed dev-pas). For example:

'''DELETE</tt>
The delete</tt> procedure deletes a substring from a string by specifying the position from which the deletion of string will start and the number of characters in a string need to be deleted. The deleted substring can not be recorvered so it's lost forever. For example:

COPY</tt>
The copy</tt> function returns the substring from the main string that starts on on the x position and has y characters. This is useful when you want to delete a substring from a string but also keep the deleted substring for later use in strings. For example:

POS</tt>
The pos</tt> function returns the position of a substring in a main string. If the substring does not exist in the main string, then the returned value will be 0. For example:

LENGTH</tt>
The length</tt> function simply returns the length of the specified string. For example: