M_WolfCurses_StringExtensions_Truncate - Maxwolf/WolfCurses GitHub Wiki
Cuts off a string given a certain input amount, useful for ensuring the user never enters more than possible into a given field.
Namespace: WolfCurses
Assembly: WolfCurses (in WolfCurses.dll) Version: 1.0.0.0 (1.0.0.0)
C#
public static string Truncate(
this string value,
int maxLength
)
- value
- Type: System.String
String that needs to be truncated to max length. - maxLength
- Type: System.Int32
Negative values will cause exception.
Type: String
Truncated string.
In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Supported in: 0.1