M_WolfCurses_StringExtensions_Truncate - Maxwolf/WolfCurses GitHub Wiki

StringExtensions.Truncate Method

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)

Syntax

C#

public static string Truncate(
	this string value,
	int maxLength
)

Parameters

 

value
Type: System.String
String that needs to be truncated to max length.
maxLength
Type: System.Int32
Negative values will cause exception.

Return Value

Type: String
Truncated string.

Usage Note

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).

Version Information

Wolf Curses

Supported in: 0.1

See Also

Reference

StringExtensions Class
WolfCurses Namespace

⚠️ **GitHub.com Fallback** ⚠️