Looking for suggestions for improvement.
Given a string, which could be null, limit the total length to no more than 20 characters
(Example, simplified for this question)
$"{value.Substring(0, Math.Min(value.Length, 20))}"
If value is "abcdefg" then the output would be "abcdefg". If value is "abcdefghijklmnopqrstuvwxyz" then output would be "abcdefghijklmnopqrstuv". Not talking about padding of a string in any way.
Is there a way to do this with a string formatter using string interpolation? For example, I've tried $"{value, 20}" and the like but that is for padding, not limiting.
Why do I need to use string interpolation? Because our code standard dictates it.