Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>center() - add leading spaces to center in <nn> width</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     center() - add leading spaces to center in <nn> width
  Usage:    <string> = center(<string>,<width>)
  Params:   string <string> - the string to center
            integer <width> - the width to center within
  Returns:  a string equal to <string> with enough leading spaces
            to center it within <width> chars. No spaces are added
            to the end. If <width> is less than the length of <string>,
            then left <nn> characters equal to <width> are returned

 ---------------------------------- Example ---------------------------------

                 ? "*"+center("Centered Text",25)
                 * prints "*      Centered Text"

                 ? center("Centered Text",5)
                 * prints "Cente"


See Also: strcenter() untrim() strexpand() strextract()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson