Substr
string-functions substr(ing)
syntax
- substr(string_dataitem, startposition, length)
- substr(string_dataitem, startposition)
definition
- 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.
- substr(string_dataitem, startposition) results in a substring of string_dataitem with all characters from the startposition argument.
applies to
- data-item string_dataitem with string value-type
- literal or parameter startposition with uint32 value type
- literal or parameter length with uint32 value type
since version
- substr(string_dataitem, startposition, length) : 5.15
- 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