Word getting cut off because string is longer than the console
Hello, I am doing the finishing touches on the little star wars database I created as practice for C#. In the first screenshot, I have circled where the word gets cut off (ignore the fact it's french) and I'm not sure how to fix this. I have also attached the code for this. Any help? (I am a very very new beginner. I started this weekend.)
4 Replies
i don't know if there's anything built in, but you could come up with a word-wrapping algorithm that takes the console width and adds newlines to the string at more convenient points
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Oh man that sounds complicated
I’ll leave it like that and come change it back when I have more experience
if you ignore the fact the console can change size the algorithm itself isn't terribly hard
i'd start with just writing a method that wraps lines to a specified maximum line length
at minimum that could be a handy reusable piece of code if you're doing a lot of displaying text