tomakita/Colorful.Console

Is it possible to center a text?

Closed this issue · 1 comments

Is it possible to center a text on the console.

Colorful.Console doesn't expose an easy way to do this (though support for text alignment is planned for the future), but if you only need to center regular text, and not Figlet text, this isn't too hard to implement yourself. Try something like this:

https://stackoverflow.com/questions/12847960/centering-text-in-c-sharp-console-app-only-working-with-some-input

Basically, all you need to do is add sufficient padding to the beginning of the string you want to write. Does that help?