Constructors: NewCharEnumerator

NewCharEnumerator

Creates an enumerator used to iterate over the Unicode characters of a String.



 Public Function NewCharEnumerator(
	  ByRef s As String,
	  Optional ByVal CopyString As Boolean ) As CharEnumerator

Parameters

s
[ByRef] String. The string to iterate each character of.
CopyString
[ByVal] Optional. Boolean. Indicates if the enumerator should create a copy of the passed in string, or use the existing string in memory.

Return Values

CharEnumerator -  A CharEnumerator used to iterate over each character of a string.

Remarks

By default CharEnumerator makes a copy of the passed in string. The original string can be changed as normal.

If CopyString is set to False, then the original string must not change or go out of scope for the duration of the CharEnumerator objects life time.

By telling CharEnumerator to not make a copy of the original string, memory is not allocated for the string, which can be helpful for large strings.

See Also

Project CorLib Overview

Class Constructors Overview