GenericExtensionsTruncateString Method |
Truncates a string to the specified length
Namespace: Lithnet.MetadirectoryServicesAssembly: Lithnet.MetadirectoryServices (in Lithnet.MetadirectoryServices.dll) Version: 1.0.6017.24765
Syntax public static string TruncateString(
this string obj,
int totalLength
)
<ExtensionAttribute>
Public Shared Function TruncateString (
obj As String,
totalLength As Integer
) As String
public:
[ExtensionAttribute]
static String^ TruncateString(
String^ obj,
int totalLength
)
Parameters
- obj
- Type: SystemString
The string to truncate - totalLength
- Type: SystemInt32
The length to truncate to
Return Value
Type:
StringA string shortened to the specified length
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