I know in C# you can do int.MaxValue
or long.MaxValue
to get the maximum for these two types, I was wondering if there are similar ways to get the maximum length for the string.
I don't see it here. Also, I am aware that there are already questions being asked on max string length. Max string length in C#
I am asking if there is an existing function that comes in handy where you can use it to set the condition when and when not to truncate your string to avoid program crashing. Or what is the normal approach?
E.g. Maybe something as easy as Max(string.length)
?