strexpand()
Returns a formatted string.
Synopsis
string strexpand(string s, unsigned length);
Parameters
Parameter | Description |
---|---|
s | Formatting |
length | Length |
Return value
Formatted string.
Errors
Missing/incorrect arguments.
Description
Returns a string of the length "length" that is formatted according to the string in s. The following format commands are available. They may, however, not be nested:
Parameter | Comment |
---|---|
\\fill{xy} | Padding of the string with "xy" |
\\left{xy} | "xy" is aligned left-justified in the string |
\\right{xy} | "xy" is aligned right-justified in the string |
\\center{xy} | "xy" is aligned centered in the string |
Example
main()
{
string s1, s2;
s1=strexpand("\\fill{ABC}", 20);
// s1 --> "ABCABCABCABCABCABCAB"
s2=strexpand("\\center{Hallo}", 11);
// s2 --> " Hallo "
}
Assignment
Strings
Availability
CTRL
See also
strformat()