C
C#9mo ago
Malo

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.)
No description
No description
4 Replies
Jimmacle
Jimmacle9mo ago
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
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
Malo
MaloOP9mo ago
Oh man that sounds complicated I’ll leave it like that and come change it back when I have more experience
Jimmacle
Jimmacle9mo ago
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
Want results from more Discord servers?
Add your server