Export (0) Print
Expand All

Strings.AscW Method (Char)

Returns an Integer value representing the character code corresponding to a character.

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public static int AscW(
	char String
)

Parameters

String
Type: System.Char
Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.

Return Value

Type: System.Int32
Returns an Integer value representing the character code corresponding to a character.

AscW returns the Unicode code point for the input character. This can be 0 through 65535. The returned value is independent of the culture and code page settings for the current thread.

The following example uses the AscW function to return Integer character codes corresponding to the first letter in each string.


Dim codeInt As Integer
' The following line of code sets codeInt to 65.
codeInt = AscW("A")
' The following line of code sets codeInt to 97.
codeInt = AscW("a")
' The following line of code sets codeInt to 65.
codeInt = AscW("Apple")


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft