Skip to main content

substring

The string function used to extract a substring from a string, given a starting index (1-based) and an optional length.

Parameter

Type

str

the string from which to extract

start

the position of the first character to extract

length

the length of substring to extract

Returns: string

Example

Query:

PREFIX : <https://ddw-doccorp.linked.data.world/d/sparql-function-sample-queries/>
PREFIX fn: <http://data.world/function/functions#>

SELECT (fn:substring("asdf", 2, 3) AS ?substring)
{
}

Run query

Results:

substring

sdf