Part 4
Properties of the Part_btwn()
1. A substring with the starting position greater or equal to the length of the original string, or the ending position less or equal to the starting position is an empty string.
m, n: Ν;
Prt_btwn (m, n, α) = Λ
iff m ≥ | α | or n ≤ m;
In other words, if the starting position of the substring is greater than the length of the string - we are off the edge of that string, and if |substring| ≤ 0, the substring is an empty string.
Example:
β = < 7, 4, 8>; | β | = 3;
In Prt_btwn (3, 3, β) = Λ;
m = 3; n = 3; m = n;
The first element is at position 4, the last is at position 3; we are off the edge.
In Prt_btwn (3, 2, β) = Λ;
m = 3; n = 2; n < m;
The ending position of the substring preceeds the starting position.
Both cases above produce an empty string.
|