SubstrBytes constructor

SubstrBytes(
  1. dynamic string,
  2. dynamic index,
  3. dynamic count
)

Creates $substrBytes operator expression

Returns the substring of a string. The substring starts with the character at the specified UTF-8 byte index (zero-based) in the string and continues for the number of bytes specified.

  • string - The string from which the substring will be extracted. string expression can be any valid expression as long as it resolves to a string. If the argument resolves to a value of null or refers to a field that is missing, $substrBytes returns an empty string. If the argument does not resolve to a string or null nor refers to a missing field, $substrBytes returns an error.
  • index - Indicates the starting point of the substring. Byte index can be any valid expression as long as it resolves to a non-negative integer or number that can be represented as an integer (such as 2.0). Byte index cannot refer to a starting index located in the middle of a multi-byte UTF-8 character.
  • count - Can be any valid expression as long as it resolves to a non-negative integer or number that can be represented as an integer (such as 2.0). Byte count can not result in an ending index that is in the middle of a UTF-8 character.

Implementation

SubstrBytes(string, index, count)
    : super('substrBytes', AEList([string, index, count]));