Wednesday, October 22, 2014

how to limit input in console in c#

You can get the buffer size of the Console by:


int buffer = Console.BufferWidth;


and the max length of a input string = buffer * 3 + 14;


For an example:


If buffer = 80; => inputstring.Length <= 254


No comments:

Post a Comment