ZennoLab Assemblies Documentation
Trim(String,String) Method
Example 

Type: System.String

The source string.

Type: System.String

The place where need performs the trim operation. It can have the following values: Begin, End or Full.

Removes all leading and trailing, leading or trailing white-space, tabulations and end of line characters from the current String object.
Syntax
public static string Trim( 
   string sourceString,
   string whereToTrim
)

Parameters

sourceString

Type: System.String

The source string.

whereToTrim

Type: System.String

The place where need performs the trim operation. It can have the following values: Begin, End or Full.

Return Value

Type: System.String

The string that remains after all specified characters are removed from the start or end of the current string.

Example
The following example shows call the Trim method.
// trim white-space and end line characters from start and end of string 
string fullTrim = Macros.TextProcessing.Trim(" string for trim operation\r\n ", "Full");
 
// trim white-space from start of string 
string beginTrim = Macros.TextProcessing.Trim(" string for trim operation\r\n ", "Begin");
 
// trim end line characters from end of string 
string endTrim = Macros.TextProcessing.Trim(" string for trim operation\r\n ", "End");
// trim white-space and end line characters from start and end of string 
$fullTrim = Macros::TextProcessing::Trim(" string for trim operation\r\n ", "Full");
 
// trim white-space from start of string 
$beginTrim = Macros::TextProcessing::Trim(" string for trim operation\r\n ", "Begin");
 
// trim end line characters from end of string 
$endTrim = Macros::TextProcessing::Trim(" string for trim operation\r\n ", "End");
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

TextProcessing Class
TextProcessing Members
Overload List
RemoveDuplicates Method
Replace Method

Send Feedback