Skip to content

Modern String PadLeft

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

Home › String Library › String Library › PadLeft

PadLeft

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

Syntax

PadLeft( s, width [, pad] )

Notes

  • O(width)

Examples

#import "std/strings"
using strings

print PadLeft( "tiko-lang", 12, "*" )    '' ***tiko-lang
print PadLeft( "42", 5, "0" )            '' 00042
print PadLeft( "tiko-lang", 4, "*" )     '' tiko -- truncated, keeping the left

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

Clone this wiki locally