C#C
C#4y ago
Rype

String alignment

I want to align the string "Set" so it doesn't get affected by the length change in the parentheses. Doing {1,4} or {2,4} won't solve it because the right
parenthesis spoils it.

Console.WriteLine("A: ({0},{1}) Set {2} Health:{3,-3}", AX, AY, setA, hpA);
Console.WriteLine("B: ({0},{1}) Set {2} Health:{3,-3}", BX, BY, setB, hpB);
Console.WriteLine("C: ({0},{1}) Set {2} Health:{3,-3}", CX ,CY, setC, hpC);

PS - I want it to look like:

A: (-1,-5) Set 2 Health:80
B: (7,8) Set 1 Health:60
C: (-6,-4) Set 3 Health:100
Was this page helpful?