IndexOfCP constructor

IndexOfCP(
  1. dynamic string,
  2. dynamic substring, [
  3. dynamic start,
  4. dynamic end,
])

Creates $indexOfCP operator expression

Searches a string for an occurence of a substring and returns the UTF-8 code point index (zero-based) of the first occurence. If the substring is not found, returns -1.

  • string - Can be any valid expression as long as it resolves to a string. If the string expression resolves to a value of null or refers to a field that is missing, $indexOfCP returns null. If the string expression does not resolve to a string or null nor refers to a missing field, $indexOfCP returns an error.
  • substring - Can be any valid expression as long as it resolves to a string. start - Optional. An integral number that specifies the starting index position for the search. Can be any valid expression that resolves to a non-negative integral number. end - Optional. An integral number that specifies the ending index position for the search. Can be any valid expression that resolves to a non-negative integral number. If you specify a end index value, you should also specify a start index value; otherwise, $indexOfCP uses the end value as the start index value instead of the [end value.

Implementation

IndexOfCP(string, substring, [start, end])
    : super('indexOfCP', AEList([string, substring, start, end]));