Substr

string-functions substr(ing)

syntax

  1. substr(string_dataitem, startposition, length)
  2. substr(string_dataitem, startposition)

definition

  1. substr(string_dataitem, startposition, length) results in a substring of string_dataitem with the number of characters of the length argument, starting from the startposition argument.
  2. substr(string_dataitem, startposition) results in a substring of string_dataitem with all characters from the startposition argument.

applies to

since version

  1. substr(string_dataitem, startposition, length) : 5.15
  2. substr(string_dataitem, startposition) : 7.142

example

attribute<string> substrA  (ADomain) := substr(A, 1, 3);
attribute<string> substr2A (ADomain) := substr(A, 1);
A substrA substr2A
‘Test’ ‘est ‘est
‘88hallo99’ ‘8ha ‘8hallo99
’+)’ ’) ’)
‘twee woorden’ ‘wee ‘wee woorden
’ test met spatie’ ‘tes ‘test met spatie

ADomain, nr of rows = 5

see also