NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

String.Trim (Char[])

Removes the given characters from both ends of the string.

[Visual Basic]
Overloads Public Function Trim( _
   ByVal trimChars() As Char _
) As String
[C#]
public string Trim(
   char[] trimChars
);
[C++]
public: String* Trim(
   __wchar_t* trimChars[]
);
[JScript]
public function Trim(
   trimChars : Char[]
) : String;

Parameters

trimChars
The array of characters to be removed.

Return Value

The substring of characters that remains after the removal of characters in trimChars from both ends of this string.

Remarks

This method begins with the first character in this string and continues to remove characters until a character is found that is not in the specified array, then it moves to the last character in this string and continues to remove characters until if finds a character that is not in the specified array. It repeats this until the end of the string. As a special case, white space can be removed from both ends of this string by passing null as the character array.

This method is case-sensitive. White space is defined by WhitespaceChars.

The trimChars parameter can be null to indicate that white space should be removed from the ends of this string.

See Also

String Class | String Members | System Namespace | String.Trim Overload List | Char