Strings.Len Metoda
Definice
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Přetížení
| Len(UInt64) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(UInt32) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(UInt16) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(String) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Single) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(SByte) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Object) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Int64) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Int16) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Double) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Decimal) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(DateTime) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Char) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Byte) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Boolean) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
| Len(Int32) |
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable. |
Len(UInt64)
Důležité
Toto rozhraní API neodpovídá specifikaci CLS.
- Alternativa odpovídající specifikaci CLS
- Microsoft.VisualBasic.Strings.Len(Int64)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(System::UInt64 Expression);
[System.CLSCompliant(false)]
public static int Len (ulong Expression);
public static int Len (ulong Expression);
[<System.CLSCompliant(false)>]
static member Len : uint64 -> int
static member Len : uint64 -> int
Public Function Len (Expression As ULong) As Integer
Parametry
- Expression
- UInt64
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
- Atributy
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(UInt32)
Důležité
Toto rozhraní API neodpovídá specifikaci CLS.
- Alternativa odpovídající specifikaci CLS
- Microsoft.VisualBasic.Strings.Len(Int32)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(System::UInt32 Expression);
[System.CLSCompliant(false)]
public static int Len (uint Expression);
public static int Len (uint Expression);
[<System.CLSCompliant(false)>]
static member Len : uint32 -> int
static member Len : uint32 -> int
Public Function Len (Expression As UInteger) As Integer
Parametry
- Expression
- UInt32
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
- Atributy
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(UInt16)
Důležité
Toto rozhraní API neodpovídá specifikaci CLS.
- Alternativa odpovídající specifikaci CLS
- Microsoft.VisualBasic.Strings.Len(Int16)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(System::UInt16 Expression);
[System.CLSCompliant(false)]
public static int Len (ushort Expression);
public static int Len (ushort Expression);
[<System.CLSCompliant(false)>]
static member Len : uint16 -> int
static member Len : uint16 -> int
Public Function Len (Expression As UShort) As Integer
Parametry
- Expression
- UInt16
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
- Atributy
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(String)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(System::String ^ Expression);
public static int Len (string? Expression);
public static int Len (string Expression);
static member Len : string -> int
Public Function Len (Expression As String) As Integer
Parametry
- Expression
- String
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Single)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(float Expression);
public static int Len (float Expression);
static member Len : single -> int
Public Function Len (Expression As Single) As Integer
Parametry
- Expression
- Single
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(SByte)
Důležité
Toto rozhraní API neodpovídá specifikaci CLS.
- Alternativa odpovídající specifikaci CLS
- Microsoft.VisualBasic.Strings.Len(Byte)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(System::SByte Expression);
[System.CLSCompliant(false)]
public static int Len (sbyte Expression);
public static int Len (sbyte Expression);
[<System.CLSCompliant(false)>]
static member Len : sbyte -> int
static member Len : sbyte -> int
Public Function Len (Expression As SByte) As Integer
Parametry
- Expression
- SByte
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
- Atributy
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Object)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(System::Object ^ Expression);
public static int Len (object? Expression);
public static int Len (object Expression);
static member Len : obj -> int
Public Function Len (Expression As Object) As Integer
Parametry
- Expression
- Object
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Int64)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(long Expression);
public static int Len (long Expression);
static member Len : int64 -> int
Public Function Len (Expression As Long) As Integer
Parametry
- Expression
- Int64
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Int16)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(short Expression);
public static int Len (short Expression);
static member Len : int16 -> int
Public Function Len (Expression As Short) As Integer
Parametry
- Expression
- Int16
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Double)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(double Expression);
public static int Len (double Expression);
static member Len : double -> int
Public Function Len (Expression As Double) As Integer
Parametry
- Expression
- Double
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Decimal)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(System::Decimal Expression);
public static int Len (decimal Expression);
static member Len : decimal -> int
Public Function Len (Expression As Decimal) As Integer
Parametry
- Expression
- Decimal
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(DateTime)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(DateTime Expression);
public static int Len (DateTime Expression);
static member Len : DateTime -> int
Public Function Len (Expression As DateTime) As Integer
Parametry
- Expression
- DateTime
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Char)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(char Expression);
public static int Len (char Expression);
static member Len : char -> int
Public Function Len (Expression As Char) As Integer
Parametry
- Expression
- Char
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Byte)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(System::Byte Expression);
public static int Len (byte Expression);
static member Len : byte -> int
Public Function Len (Expression As Byte) As Integer
Parametry
- Expression
- Byte
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Boolean)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(bool Expression);
public static int Len (bool Expression);
static member Len : bool -> int
Public Function Len (Expression As Boolean) As Integer
Parametry
- Expression
- Boolean
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)
Platí pro
Len(Int32)
Vrátí celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů potřebný k uložení proměnné.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
public:
static int Len(int Expression);
public static int Len (int Expression);
static member Len : int -> int
Public Function Len (Expression As Integer) As Integer
Parametry
- Expression
- Int32
Libovolný platný String výraz nebo název proměnné.Any valid String expression or variable name. Pokud Expression je typ Object , Len funkce vrátí velikost tak, jak bude zapsána do souboru FilePut funkcí.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Návraty
Celé číslo obsahující buď počet znaků v řetězci, nebo nominální počet bajtů požadovaných k uložení proměnné.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Příklady
Tento příklad používá Len k vrácení počtu znaků v řetězci.This example uses Len to return the number of characters in a string.
' Initializes variable.
Dim testString As String = "Hello World"
' Returns 11.
Dim testLen As Integer = Len(testString)
Poznámky
Pomocí uživatelsky definovaných typů a Object proměnných Len vrátí funkce velikost tak, jak bude zapsána do souboru FilePut funkcí.With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. Pokud Object obsahuje String , vrátí délku řetězce.If an Object contains a String, it will return the length of the string. Pokud Object obsahuje jiný typ, vrátí velikost objektu tak, jak bude zapsán do souboru FilePut funkcí.If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
VBFixedStringAtribut lze použít na pole řetězce v objektech k určení velikosti řetězce v bajtech při zápisu na disk.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. LenFunkce používá VBFixedString atribut, je-li k dispozici, při určování velikosti Object proměnných.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Poznámka
LenFunkce nemusí být schopná určit skutečný počet bajtů úložiště vyžadovaných při použití s řetězci s proměnnou délkou v uživatelsky definovaných datových typech.The Len function may not be able to determine the actual number of storage bytes required when used with variable-length strings in user-defined data types.
Poznámka
LenBFunkce v dřívějších verzích Visual Basic vrátí počet bajtů v řetězci namísto znaků.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. 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 aktuální Visual Basic řetězce jsou v kódování Unicode a LenB již nejsou podporovány.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Poznámky pro vývojáře inteligentního zařízeníSmart Device Developer Notes
LenFunkce přijímá pouze String proměnné a Object jako parametry.The Len function accepts only String and Object variables as parameters. Pokud Object obsahuje String , vrátí délku String .If an Object contains a String, it will return the length of the String. Pokud je parametr odkazem s hodnotou NULL Object , vrátí funkce hodnotu nula.If a parameter is a NULL Object reference, the function returns zero. Pokud Object obsahuje jiný typ, je vyvolána výjimka.If an Object contains any other type, an exception is thrown.
Viz také
- FilePut
- VBFixedStringAttribute
- Len
- Souhrn manipulace s řetězciString Manipulation Summary
- Souhrn datových typů (Visual Basic)Data Type Summary (Visual Basic)