Skip to content

Modern String PadRight

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › String Library › String Library › PadRight

PadRight

Pads on the right to a width, with spaces or a given character.

Syntax

PadRight( s, width [, pad] )

Notes

  • O(width)

Examples

#import "std/strings"
using strings

print PadRight( "tiko-lang", 12, "*" )    '' tiko-lang***
print PadRight( "tiko-lang", 12 )         '' tiko-lang    (spaces)

'' The result is ALWAYS exactly `width` -- longer input is truncated,
'' which is what makes a column line up whatever is in it
print PadRight( "tiko-lang", 4, "*" )     '' tiko

Library: String Library
Category: String Library
Documented under: The Functions

Clone this wiki locally