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).

Returns: string

Table 1.

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



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)
{
}

Try the query

Table 2. Results

rpad

foo*****