cString: Trim

Trim

Trims both the beginning and end of the string.



 Public Function Trim(
	  ByRef s As String,
	  Optional ByRef TrimChars As Variant ) As String

Parameters

s
[ByRef] String. The string to be trimmed.
TrimChars
[ByRef] Optional. Variant. The characters to remove.

Return Values

String -  The trimmed string.

Remarks

Unlike VBs Trim function, this can trim multiple character types, not just spaces.

The trimChars can be either a string of the characters or an integer array of characters that will be trimmed from both ends.

See Also

Project VBCorLib Overview Class cString Overview cString Properties cString Methods ToCharArray TrimEnd