Returns a string that centers the given text using placeholder
Optional
The text to inspect
The max width of the expected string
The placeholder to pad
a string that centers the given text using placeholder
David Hsing
center('foobar', -1); // 'foobar'center('foobar', 0); // ''center('foobar', 3); // 'foobar'center('foobar', 7); // 'foobar 'center('foobar', 10); // ' foobar ' Copy
center('foobar', -1); // 'foobar'center('foobar', 0); // ''center('foobar', 3); // 'foobar'center('foobar', 7); // 'foobar 'center('foobar', 10); // ' foobar '
Returns a string that centers the given text using placeholder