Constructors: NewChars

NewChars

Initializes an Integer array representing Unicode characters with elements copied from Values.



 Public Function NewChars(
	  ParamArray Values ( ) As Variant ) As Integer ( )

Parameters

Values
[ByRef] Variant. A series of characters or their Unicode code points.

Return Values

Integer() -  An Integer array containing a set of Unicode characters.

Remarks

This is a convenience method to easily create an Integer array representing Unicode characters.

If a string with more than one character is processed, only the first character will be recognized. To convert an entire string to a character array use CorString.ToCharArray.

Examples

This example creates a new character array using both string and Unicode values then displays them.

Public Sub Main()
    Dim Chars() As Integer
    Dim Char As Variant
    
    Chars = NewChars("a", "b", 99, 100)
    
    Debug.Print "The set of characters."
    
    For Each Char In Chars
        Debug.Print CorString.Format("{0,3} = ""{0:$}""", Char)
    Next
End Sub

' This example code produces the following output.
'
'    The set of characters.
'     97 = "a"
'     98 = "b"
'     99 = "c"
'    100 = "d"

See Also

Project CorLib Overview

Class Constructors Overview

NewString

CorString