Strings.Len Método
Definición
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Sobrecargas
| Len(UInt64) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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) |
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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)
Importante
Esta API no es conforme a CLS.
- Alternativa conforme a CLS
- Microsoft.VisualBasic.Strings.Len(Int64)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- UInt64
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
- Atributos
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(UInt32)
Importante
Esta API no es conforme a CLS.
- Alternativa conforme a CLS
- Microsoft.VisualBasic.Strings.Len(Int32)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- UInt32
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
- Atributos
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(UInt16)
Importante
Esta API no es conforme a CLS.
- Alternativa conforme a CLS
- Microsoft.VisualBasic.Strings.Len(Int16)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- UInt16
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
- Atributos
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(String)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- String
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Single)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Single
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(SByte)
Importante
Esta API no es conforme a CLS.
- Alternativa conforme a CLS
- Microsoft.VisualBasic.Strings.Len(Byte)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- SByte
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
- Atributos
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Object)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Object
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Int64)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Int64
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Int16)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Int16
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Double)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Double
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Decimal)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Decimal
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(DateTime)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- DateTime
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Char)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Char
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Byte)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Byte
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Boolean)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Boolean
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)
Se aplica a
Len(Int32)
Devuelve un entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.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
Parámetros
- Expression
- Int32
Cualquier expresión de tipo String o nombre de variable válidos.Any valid String expression or variable name. Si Expression es del tipo Object, la función Len devuelve el tamaño con el que la función FilePut escribirá en el archivo.If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.
Devoluciones
Número entero que contiene el número de caracteres de una cadena o el número nominal de bytes necesarios para almacenar una variable.An integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Ejemplos
En este ejemplo se utiliza Len para devolver el número de caracteres de una cadena: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)
Comentarios
Con las variables y los tipos definidos por el usuario Object , la Len función devuelve el tamaño tal y como se escribirá en el archivo mediante la FilePut función.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. Si un Object contiene un String , devolverá la longitud de la cadena.If an Object contains a String, it will return the length of the string. Si un Object contiene cualquier otro tipo, devolverá el tamaño del objeto, ya que la función lo escribirá en el archivo FilePut .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.
El VBFixedString atributo se puede aplicar a los campos de cadena de los objetos para indicar el tamaño de la cadena, en bytes, cuando se escribe en el disco.The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. La Len función utiliza el VBFixedString atributo, si está disponible, al determinar el tamaño de Object las variables.The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.
Nota
LenEs posible que la función no pueda determinar el número real de bytes de almacenamiento necesarios cuando se usa con cadenas de longitud variable en tipos de datos definidos por el usuario.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.
Nota
La LenB función de versiones anteriores de Visual Basic devuelve el número de bytes de una cadena en lugar de caracteres.The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. Se usa principalmente para convertir cadenas en aplicaciones de juegos de caracteres de doble byte (DBCS).It is used primarily for converting strings in double-byte character set (DBCS) applications. Todas las cadenas de Visual Basic actuales están en Unicode y ya LenB no se admiten.All current Visual Basic strings are in Unicode, and LenB is no longer supported.
Notas para desarrolladores de Smart DeviceSmart Device Developer Notes
La Len función solo acepta String Object variables y como parámetros.The Len function accepts only String and Object variables as parameters. Si un Object contiene un String , devolverá la longitud de String .If an Object contains a String, it will return the length of the String. Si un parámetro es una Object referencia nula, la función devuelve cero.If a parameter is a NULL Object reference, the function returns zero. Si un Object contiene cualquier otro tipo, se produce una excepción.If an Object contains any other type, an exception is thrown.
Consulte también
- FilePut
- VBFixedStringAttribute
- Len
- Resumen de la manipulación de cadenasString Manipulation Summary
- Resumen de tipos de datos (Visual Basic)Data Type Summary (Visual Basic)