{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "scalar",
  "name" : "substring",
  "description" : "Returns a substring of a string, specified by a start position and an optional length.",
  "signatures" : [
    {
      "params" : [
        {
          "name" : "string",
          "type" : "keyword",
          "optional" : false,
          "description" : "String expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position."
        },
        {
          "name" : "length",
          "type" : "integer",
          "optional" : true,
          "description" : "Length of the substring from the start position. Optional; if omitted, all positions after `start` are returned."
        }
      ],
      "variadic" : false,
      "returnType" : "keyword"
    },
    {
      "params" : [
        {
          "name" : "string",
          "type" : "text",
          "optional" : false,
          "description" : "String expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position."
        },
        {
          "name" : "length",
          "type" : "integer",
          "optional" : true,
          "description" : "Length of the substring from the start position. Optional; if omitted, all positions after `start` are returned."
        }
      ],
      "variadic" : false,
      "returnType" : "keyword"
    }
  ],
  "examples" : [
    "FROM employees\n| KEEP last_name\n| EVAL ln_sub = SUBSTRING(last_name, 1, 3)",
    "FROM employees\n| KEEP last_name\n| EVAL ln_sub = SUBSTRING(last_name, -3, 3)",
    "FROM employees\n| KEEP last_name\n| EVAL ln_sub = SUBSTRING(last_name, 2)"
  ],
  "preview" : false,
  "snapshot_only" : false
}
