View/Edit #29:centre center

Switch to edit mode.

Name(s): centre center
1: ":center/re (string, width[, lfill[, rfill]]) => centered string in field"
2: "Left and right fillers default to spaces.  Bilingualism-aware."
3: {string, len, ?lfill = " ", ?rfill = lfill} = args
4: string = this:slice_tagged(tostr(string), len)
5: if ((l = $msg:string_length(string)) < len)
6:   string = this:space((len - l) / 2, lfill) + string + this:space((len - l + 1) / -2, rfill)
7: endif
8: return string

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Hacker (#60)

You are not logged in.

[home | help | who | search | setup | code]