StringExtensionsTruncate(String, Int32, String) Method

Truncates the input string given to the length specified and possibly adds an ellipsis at the end to mark a truncation

Definition

Namespace: PCBI_CadanceFab_Import
Assembly: PCBI_CadanceFab_Import (in PCBI_CadanceFab_Import.dll) Version: 16.0.0.0 (16.0.0.0)
C#
public static string Truncate(
	this string input,
	int length,
	string ellipsis
)

Parameters

input  String
The input string to truncate
length  Int32
The desired maximum length of the resulting string
ellipsis  String
An ellipsis to append to the end of a string when it gets truncated or null if no ellipsis is required

Return Value

String
The input string possibly truncated at the desired length with the ellipsis added. The length of the resulting string will never exceed the length specified

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