© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
16 replies
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Alignment
C#CC# / help
3y ago
✅ Alignment messed up?
C#CC# / help
3y ago
Memory copying with alignment
C#CC# / help
7mo ago