Name

substring( ) — returns a selected substring of the src string

Synopsis

Defined in: XPath 1.0
Parameters: string src (required); number start (required); number length (optional)
Return type: string

The returned substring is determined by starting with the startth character, and continuing on for length characters. If the length parameter is omitted, the returned string continues on to the end of the src string.

The following example returns “34”, and the second following example returns “345”:

substring("12345", 3, 2)
substring("12345", 3)

Get XForms Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.