ibis.expr.api.StringValue.rpad

StringValue.rpad(length, pad=' ')

Returns string of given length by truncating (on right) or padding (on right) original string

Parameters:
length : int
pad : string, default is ‘ ‘
Returns:
padded : string

Examples

>>> import ibis
>>> table = ibis.table([('string_col', 'string')])
>>> expr = table.string_col.rpad(5, '-')
>>> expr = ibis.literal('a').rpad(5, '-')  # 'a' becomes 'a----'
>>> expr = ibis.literal('abcdefg').rpad(5, '-')  # 'abcdefg' becomes 'abcde'  # noqa: E501