Strings.AscW Metoda

Definice

Vrací celočíselnou hodnotu představující kód znaku odpovídající znaku.Returns an integer value representing the character code corresponding to a character.

Přetížení

AscW(Char)

Vrací celočíselnou hodnotu představující kód znaku odpovídající znaku.Returns an integer value representing the character code corresponding to a character.

AscW(String)

Vrací celočíselnou hodnotu představující kód znaku odpovídající znaku.Returns an integer value representing the character code corresponding to a character.

AscW(Char)

Vrací celočíselnou hodnotu představující kód znaku odpovídající znaku.Returns an integer value representing the character code corresponding to a character.

public:
 static int AscW(char String);
public static int AscW (char String);
static member AscW : char -> int
Public Function AscW (String As Char) As Integer

Parametry

String
Char

Povinná hodnota.Required. Libovolný platný Char String výraz or.Any valid Char or String expression. Pokud String je String výraz, je pro vstup použit pouze první znak řetězce.If String is a String expression, only the first character of the string is used for input. Pokud String je Nothing nebo neobsahuje žádné znaky, ArgumentException dojde k chybě.If String is Nothing or contains no characters, an ArgumentException error occurs.

Návraty

Int32

Kód znaku odpovídající znaku.The character code corresponding to a character.

Příklady

Následující příklad používá Asc funkci pro návrat Integer kódů znaků odpovídajících prvnímu písmenu v každém řetězci.The following example uses the Asc 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 = Asc("A")
' The following line of code sets codeInt to 97.
codeInt = Asc("a")
' The following line of code sets codeInt to 65.
codeInt = Asc("Apple")

Poznámky

Asc Vrátí bod kódu nebo kód znaku pro vstupní znak.Asc returns the code point, or character code, for the input character. Může se jednat o rozsah 0 až 255 pro hodnoty jednobajtové znakové sady (SBCS) a rozsah -32768 až 32767 pro hodnoty dvoubajtové znakové sady (DBCS).This can be 0 through 255 for single-byte character set (SBCS) values and -32768 through 32767 for double-byte character set (DBCS) values.

AscW Vrátí bod kódu Unicode pro vstupní znak.AscW returns the Unicode code point for the input character. Může se jednat o rozsah 0 až 65535.This can be 0 through 65535. Vrácená hodnota je nezávislá na nastavení jazykové verze a znakové stránky pro aktuální vlákno.The returned value is independent of the culture and code page settings for the current thread.

Poznámka

AscBFunkce dřívějších verzí Visual Basic vrátí kód pro bajt, nikoli znak.The AscB function of earlier versions of Visual Basic returns a code for a byte, rather than a character. Používá se především pro převod řetězců v aplikacích dvoubajtové znakové sady (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Všechny řetězce Visual Basic 2005 jsou v kódování Unicode a AscB již nejsou podporovány.All Visual Basic 2005 strings are in Unicode, and AscB is no longer supported.

Viz také

Platí pro

AscW(String)

Vrací celočíselnou hodnotu představující kód znaku odpovídající znaku.Returns an integer value representing the character code corresponding to a character.

public:
 static int AscW(System::String ^ String);
public static int AscW (string String);
static member AscW : string -> int
Public Function AscW (String As String) As Integer

Parametry

String
String

Povinná hodnota.Required. Libovolný platný Char String výraz or.Any valid Char or String expression. Pokud String je String výraz, je pro vstup použit pouze první znak řetězce.If String is a String expression, only the first character of the string is used for input. Pokud String je Nothing nebo neobsahuje žádné znaky, ArgumentException dojde k chybě.If String is Nothing or contains no characters, an ArgumentException error occurs.

Návraty

Int32

Kód znaku odpovídající znaku.The character code corresponding to a character.

Příklady

Následující příklad používá Asc funkci pro návrat Integer kódů znaků odpovídajících prvnímu písmenu v každém řetězci.The following example uses the Asc 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 = Asc("A")
' The following line of code sets codeInt to 97.
codeInt = Asc("a")
' The following line of code sets codeInt to 65.
codeInt = Asc("Apple")

Poznámky

Asc Vrátí bod kódu nebo kód znaku pro vstupní znak.Asc returns the code point, or character code, for the input character. Může se jednat o rozsah 0 až 255 pro hodnoty jednobajtové znakové sady (SBCS) a rozsah -32768 až 32767 pro hodnoty dvoubajtové znakové sady (DBCS).This can be 0 through 255 for single-byte character set (SBCS) values and -32768 through 32767 for double-byte character set (DBCS) values.

AscW Vrátí bod kódu Unicode pro vstupní znak.AscW returns the Unicode code point for the input character. Může se jednat o rozsah 0 až 65535.This can be 0 through 65535. Vrácená hodnota je nezávislá na nastavení jazykové verze a znakové stránky pro aktuální vlákno.The returned value is independent of the culture and code page settings for the current thread.

Poznámka

AscBFunkce dřívějších verzí Visual Basic vrátí kód pro bajt, nikoli znak.The AscB function of earlier versions of Visual Basic returns a code for a byte, rather than a character. Používá se především pro převod řetězců v aplikacích dvoubajtové znakové sady (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Všechny řetězce Visual Basic 2005 jsou v kódování Unicode a AscB již nejsou podporovány.All Visual Basic 2005 strings are in Unicode, and AscB is no longer supported.

Viz také

Platí pro