Click or drag to resize
HelpersExtensionsTruncate Method
Truncates string to specified length.

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 11.0.0
Syntax
C#
public static string Truncate(
	this string str,
	int length
)

Parameters

str
Type: SystemString
Given string
length
Type: SystemInt32
Length to truncate string to

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