I have strings like these:
azu3zS1YdQBF75qmp4oyi1/ttG6/ikOSkZZCdgAYGw2x8A4YBILnZ6lOhIRNgQJEcH56pqnrb8Y=
and I do not know the exact length of them so I want a function to change any strinng to a string of 20 characters.
I have strings like these:
azu3zS1YdQBF75qmp4oyi1/ttG6/ikOSkZZCdgAYGw2x8A4YBILnZ6lOhIRNgQJEcH56pqnrb8Y=
and I do not know the exact length of them so I want a function to change any strinng to a string of 20 characters.
Try like this:
var x= str== null
? string.Empty
: str.Substring(0, Math.Min(20, str.Length));