Skip to main content

lpad

The string function used to left-pad a string to a given length, using a given character (or space, if no character is given).

Parameter

Type

Description

str

string

the string to left pad

length

integer

the length to which to pad the string

pad

string

an optional padding character

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:lpad("foo", 8) AS ?lpad)
{
}

Run query

Results:

lpad

foo