Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PadRight() [2/2]

string System.String.PadRight ( int totalWidth,
char paddingChar )
inline

Definition at line 2267 of file String.cs.

2268 {
2269 if (totalWidth < 0)
2270 {
2271 throw new ArgumentOutOfRangeException("totalWidth", SR.ArgumentOutOfRange_NeedNonNegNum);
2272 }
2273 int length = Length;
2274 int num = totalWidth - length;
2275 if (num <= 0)
2276 {
2277 return this;
2278 }
2279 string text = FastAllocateString(totalWidth);
2280 Buffer.Memmove(ref text._firstChar, ref _firstChar, (nuint)length);
2281 new Span<char>(ref Unsafe.Add(ref text._firstChar, length), num).Fill(paddingChar);
2282 return text;
2283 }
char _firstChar
Definition String.cs:35
static string FastAllocateString(int length)

References System.String._firstChar, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.String.FastAllocateString(), System.length, System.String.Length, System.Buffer.Memmove(), and System.text.