substr - ryzom/ryzomcore GitHub Wiki


title: Substring description: published: true date: 2023-03-12T23:35:38.683Z tags: editor: markdown dateCreated: 2023-03-12T23:35:35.518Z

substr

The substr native AI script function returns a substring of the input string.

Syntax

(substring: s)substr(string: s, start: f, length: f)

Arguments

  • string (string): The input string.
  • start (float): The index of the first character to copy.
  • length (float): The length of the returned substring.

Return value

  • substring (string): A substring of the input string starting at character start and length characters long.

Example

($str)result = substr("Hello, world!", 7, 5);

This example code returns the substring "world".

⚠️ **GitHub.com Fallback** ⚠️