Your comments

Some examples of documentation for functions that operate in the same way as Control's SUBSTRING:

  • The W3C XPath function “substring” standard (https://www.w3.org/TR/xpath-functions-31/#func-substring)
    W3C explains the function as:
    fn:substring(      $sourceString    as xs:string?, $start        as xs:double, $length    as xs:double) as xs:string
    The function returns a string comprising those ·characters·of $sourceString whose index position (counting from one) is greater than or equal to the value of $start (rounded to an integer), and (if $length is specified) less than the sum of $start and $length (both rounded to integers).
  • The Visual Basic MID Function (Microsoft VisualBasic - Strings - MID Function)
    Mid(String, Int32, Int32)                Returns a string that contains a specified number of characters starting from a specified position in a string.


It has been suggested that the second explanation is correct, citing https://www.w3schools.com/jsref/jsref_substring.asp.

However this article is for the JavaScript Substring function.  (And is not official documentation for the JavaScript function standard or third party implementations) The JavaScript Substring function takes three parameters. The first is the string to process, the second is the starting position (which is a 0 based index), and the third is the ending position.
To extract the characters “test” (5-9) from the string “wordtesting” the Javascript substring call would be: substring(“wordtesting”,4,8).
The page also clearly states that the returned string consists of the characters that are BETWEEN the starting and ending position. BETWEEN is reasonable inclusive of the starting character, and exclusive of the ending character. It never uses the contradiction of saying that the returned string is THROUGH and is exclusive of an ending character index.