I am now taking parts of string like this:
something.Substring(0, something.Length >= 8 ? 8 : something.Length)
The only reason for that extra mess is because sometimes the length is smaller than what I put in the method parameter and this causes an error.
Is there a simpler way to crop text safely?
Write an extension method on
stringthat hides the “mess” away.