String Processing

FUNCTION DEFINITION
= , ==, !=, <>, <=, >=, < , > All common equality/inequality operators are applicable to strings and are applied in a case sensitive manner. In the following example x, y and z are of type string. (eg: not((x <= 'AbC') and ('1x2y3z' <> y)) or (z == x))
in True only if $x$ is a substring of $y$. (eg: x in y or 'abc' in 'abcdefgh')
like True only if the string x matches the pattern y. Available wildcard characters are `*' and `?' denoting zero or more and zero or one matches respectively. (eg: x like y or 'abcdefgh' like 'a?d*h')
ilike True only if the string x matches the pattern y in a case insensitive manner. Available wildcard characters are '*' and '?' denoting zero or more and zero or one matches respectively. (eg: x ilike y or 'a1B2c3D4e5F6g7H' ilike 'a?d*h')
[r0:r1] The closed interval $[r0,r1]$ of the specified string. eg: Given a string x with a value of 'abcdefgh' then:
  1. x[1:4] == 'bcde'
  2. x[ :5] == x[:10 / 2] == 'abcdef'
  3. x[2 + 1: ] == x[3:] =='defgh'
  4. x[ : ] == x[:] == 'abcdefgh'
  5. x[4/2:3+2] == x[2:5] == 'cdef'
Note: Both r0 and r1 are assumed to be integers, where r0 <= r1. They may also be the result of an expression, in the event they have fractional components truncation will be performed. (eg: $1.67
\rightarrow 1$)
:= Assign the value of x to y. Where y is a mutable string or string range and x is either a string or a string range. eg:
  1. y := x
  2. y := 'abc'
  3. y := x[:i + j]
  4. y := '0123456789'[2:7]
  5. y := '0123456789'[2i + 1:7]
  6. y := (x := '0123456789'[2:7])
  7. y[i:j] := x
  8. y[i:j] := (x + 'abcdefg'[8 / 4:5])[m:n]

Note: For options 7 and 8 the shorter of the two ranges will denote the number characters that are to be copied.

+ Concatenation of x and y. Where x and y are strings or string ranges. eg
  1. x + y
  2. x + 'abc'
  3. x + y[:i + j]
  4. x[i:j] + y[2:3] + '0123456789'[2:7]
  5. 'abc' + x + y
  6. 'abc' + '1234567'
  7. (x + 'a1B2c3D4' + y)[i:2j]
+= Append to x the value of y. Where x is a mutable string and y is either a string or a string range. eg:
  1. x += y
  2. x += 'abc'
  3. x += y[:i + j] + 'abc'
  4. x += '0123456789'[2:7]
<=> Swap the values of x and y. Where x and y are mutable strings. (eg: x <=> y)
[] The string size operator returns the size of the string being actioned. eg:
  1. 'abc'[] == 3
  2. var max_str_length := max(s0[],s1[],s2[],s3[]
  3. ('abc' + 'xyz')[] == 6
  4. (('abc' + 'xyz')[1:4])[] == 4