Is there a way for me to align text to the right side of my Console Application? I want to print a String with “[ok]” on the same line but on the right hand side. Like you see when booting a Linux Distro.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would suggest using curses as @Oded said.
If you really don’t want to use any third party libraries, you can use
Console.BufferWidthto get size of console and thenConsole.Console.CursorLeftto set column position.The above prints [ok] at the end of the current line, leaving cursor at the first column, next line