In Pascal, you can select part of a string (substring). For this, the copy operation is used.
The general form of the operation is as follows:
s1 := copy(s, index, count);
This command takes a slice from the string s, starting at the character at index index of length count.
For example,
s1 := copy(s, 3, 5);
If index is greater than the length of the string, then an empty string is returned. If count characters, starting at index, are longer than the length of the string, then the string s is returned, starting at index and ending.

And here's how easy it is to reverse a string:
s := '0123456789';
s1 := reverseString(s); // s1 = '0123'

To delete part of a string, you need to use the delete(s, firstIndex, count) method: it removes count characters from the string s, starting from firstIndex
s := '0123456789';
delete(s, 4, 6); // s1="0129"

To copy part of a string, you can use the copy(s, index, count) method - it will return a part of the string s, starting at index index and length count
 

s := '123456789';
s1 := copy(s, 3, 4); // s1 = '3456'

Pascal has many routines for working with strings.  Many of them are called using dot notation and are called methods. A complete list of string manipulation methods can be found online. 
Let's get acquainted with some of them.
s := 'aAbBcC'
sUp := uppercase(s); // sUp = "AABBCC" - a method that converts each character of a string to uppercase
sLow := lowercase(s) // sLow = "aabbcc" - a method that converts each character of a string to lowercase
The method is always written with parentheses. There are some parameters inside the brackets, if they are needed.

Another useful method  - val(s, v, ind) - method to check if all characters of a string are digits. s - source string, v contains a number if the source string was a number, and 0 otherwise, ind contains the number of the first index s which is not a digit, or 0 if s is a number.
s := 'ab1c'
val(s, v, ind);
writeln(v, ' ', ind); // 0 3
s := '123';
val(s, v, ind);
w(vriteln, ' ', ind); // 123 0
The useful trim(s) - method allows you to remove spaces at the beginning and end of a string
s := ' ab 1c ';
print('s=', trim(s)); // s=ab 1c

To search within a string in Pascal, use the pos() method.
It has returns the index of the 1st occurrence of the substring in the string:
pos(originalString, smallString) - looks in originalString smallString

When the substring is not found, the method returns 0:

welcome := 'Hello world! Goodbye world!';
index := pos(welcome, 'wor');
writeln(index); // 7

index := pos(welcome, 'sun');
writeln(index); // 0

Please note: these methods do not look for the number of occurrences, but only determine whether there is such a substring in the string or not.

In Pascal, to replace one substring with another in a string, use the stringReplace()
method stringReplace(original, old, new, flag): originalString  substring old is replaced on newflag is one of the rfReplaceAll or rfIgnoreCase, values ​​written to square brackets. In the first case, all occurrences of old into originalString, in the second, only the first.

Pascal string substitution example:
 

phone = '+1-234-567-89-10'

// hyphens are changed to spaces
edited_phone := stringreplace(phone, '-', ' ', [rfReplaceAll]);
writeln(edited_phone); // +1 234 567 89 10

// hyphens are removed
edited_phone := stringreplace(phone, '-', '', [rfReplaceAll]);
writeln(edited_phone); // +12345678910

// only the first dash changes
edited_phone := replace(phone, '-', '', [rfIgnoreCase]);
writeln(edited_phone); // +1234-567-89-10