Skip to main content

rpad

The string function used to right-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 right 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:rpad("foo", 8, "*") AS ?rpad)
{
}

Run query

Results:

rpad

foo*****