Class StringExtensions
Extension methods for the string type.
public static class StringExtensions
- Inheritance
-
StringExtensions
- Inherited Members
Methods
Truncate(string?, int)
Truncates the specified string to the specified maximum length.
public static string? Truncate(this string? value, int maxLength)
Parameters
Returns
- string
A truncated string if the length exceeds the specified maximum length; otherwise, the original string.