Functions Index :: S :: StrFill

[<< up one level]

Module:

string :: core

Definition:

StrFill(string s, int count, bool "strict")

Description:

Returns a string consisting of count repetitions of s.

If count == 0, a null string is returned.

The strict optional parameter when set to false makes the function to return a null string when a negative count value is passed (the default behavior is to throw an error).

Examples:

s = StrFill("a", 12) # s == "aaaaaaaaaaaa"

t = StrFill("abc", 3) # t == "abcabcabc"

u = StrFill("abc", 0) # u == ""

# this will halt script with an error

v = StrFill("abc", -1)

# this will return a null string (same result as u, above)

v = StrFill("abc", -1, false)

 

[<< top]