Right-aligns the characters in the current instance, padding with spaces on the left, for a specified total length.
- totalWidth
- A int containing the number of characters in the resulting string.
A new string that is equivalent to the current instance right-aligned and padded on the left with as many spaces as needed to create a length of totalWidth. If totalWidth is less than the length of the current instance, returns a new string that is identical to the current instance.
Type Reason ArgumentException totalWidth is less than zero.
Note: A space in Unicode format is defined as the hexadecimal value 0x20.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0