Click or drag to resize

StringUtilsTruncate Method (String, Int32, Boolean, String)

Truncate the specified string to be no longer than the specified length. The original string is unmodified and the modified string is returned. If so specified, ellipses will be added to truncated strings if maxLength is greater than a minimum threshhold (currently 10 chars). Note that the truncated string INCLUDING ellipses will be of maxLength.

Namespace:  NetQuarry
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
public static string Truncate(
	string s,
	int maxLength,
	bool ellipses,
	string logSource
)

Parameters

s
Type: SystemString
The string to truncate.
maxLength
Type: SystemInt32
The maximum length of the string.
ellipses
Type: SystemBoolean
Specifies whether or not to add ellipses to truncated strings.
logSource
Type: SystemString
If provided, a devlog entry will be generated if the string is truncated and this value will be passed to LogMessage(String, String, String, LogMessageLevel).

Return Value

Type: String
The truncated string.
See Also