User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

center [2006/07/25 21:22] (current)
Line 1: Line 1:
 +# $EPIC: center.txt,​v 1.2 2006/07/17 19:41:50 sthalik Exp $
 +$__center__(<​width>​ <​text>​)
 +This function returns the input text right-justified in a buffer that is
 +precisely (** ((width - strlen(text)) / 2) + strlen(text)** ) characters
 +wide.  The width must be given, there is no default.
 +This function returns the given text, padded on the left such that it
 +will appear to be "​centered"​ in the width given. ​ The right side is not
 +padded, only the left.  To force padding on both sides, you must use the
 +width qualifier $[]var.
 +Input text centered in given width.
 +$center(15 hello there) ​              ​returns " ​ hello there"
 +$[15]center(15 hello there) ​          ​returns " ​ hello there  "
center.txt ยท Last modified: 2006/07/25 21:22 (external edit)