翻訳への提案を行います
 
他のユーザーによる提案:

progress indicator
他の提案はありません。
クリックして評価とフィードバックをお寄せください
MSDN
MSDN ライブラリ
.NET 開発
.NET Framework 4
Microsoft.VisualBasic 名前空間
Microsoft.VisualBasic
Strings クラス
Strings メソッド
Len メソッド
 Len メソッド (Int32)
すべて縮小/すべて展開 すべて縮小
コンテンツの表示:   英語と日本語を並べて表示コンテンツの表示: 英語と日本語を並べて表示
.NET Framework Class Library
Strings..::.Len Method (Int32)

Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
Visual Basic
Public Shared Function Len ( _
    Expression As Integer _
) As Integer
C#
public static int Len(
    int Expression
)
Visual C++
public:
static int Len(
    int Expression
)
F#
static member Len : 
        Expression:int -> int 

Parameters

Expression
Type: System..::.Int32
Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file by the FilePut function.

Return Value

Type: System..::.Int32
Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.

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. If an Object contains a String, it will return the length of the string. 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.

The VBFixedString attribute can be applied to string fields in objects to indicate the size of the string, in bytes, when written to disk. The Len function uses the VBFixedString attribute, if available, when determining the size of Object variables.

NoteNote

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.

NoteNote

The LenB function in earlier versions of Visual Basic returns the number of bytes in a string rather than characters. It is used primarily for converting strings in double-byte character set (DBCS) applications. All current Visual Basic strings are in Unicode, and LenB is no longer supported.

Smart Device Developer Notes

The Len function accepts only String and Object variables as parameters. If an Object contains a String, it will return the length of the String. If a parameter is a NULL Object reference, the function returns zero. If an Object contains any other type, an exception is thrown.

This example uses Len to return the number of characters in a string.

Visual Basic
' Initializes variable.
Dim TestString As String = "Hello World"
' Returns 11.
Dim TestLen As Integer = Len(TestString)

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework クラス ライブラリ
Strings..::.Len メソッド (Int32)

文字列内の文字数または変数を格納するために必要な公称バイト数を表す整数を返します。

名前空間:  Microsoft.VisualBasic
アセンブリ:  Microsoft.VisualBasic (Microsoft.VisualBasic.dll 内)
Visual Basic
Public Shared Function Len ( _
    Expression As Integer _
) As Integer
C#
public static int Len(
    int Expression
)
Visual C++
public:
static int Len(
    int Expression
)
F#
static member Len : 
        Expression:int -> int 

パラメーター

Expression
型: System..::.Int32
任意の有効な String 型の式または変数名。 Expression の型が Object である場合、Len 関数は、その型が FilePut 関数によってファイルに書き込まれるときのサイズを返します。

戻り値

型: System..::.Int32
文字列内の文字数または変数を格納するために必要な公称バイト数を表す整数を返します。

ユーザー定義の型およびオブジェクト型 (Object) の変数の場合、Len 関数はその型が FilePut 関数によってファイルに書き込まれるときのサイズを返します。 Object に文字列型 (String) が含まれる場合は、文字列の長さを返します。 Object にその他の型が含まれる場合は、オブジェクトが FilePut 関数によってファイルに書き込まれるときのサイズを返します。

VBFixedString 属性をオブジェクト内の文字列フィールドに適用すると、ディスクに書き込むときに文字列のサイズをバイト数で示すことができます。 Len 関数は、Object 変数のサイズを判断するとき VBFixedString 属性を (可能であれば) 使用します。

メモメモ

Len 関数をユーザー定義のデータ型に含まれる可変長文字列に対して実行する場合は、格納に必要な実際のバイトを決定できない場合があります。

メモメモ

以前のバージョンの Visual Basic では、LenB 関数は文字数ではなくバイト数を返していました。 これは主に、2 バイト文字セット (DBCS) アプリケーションで文字列を変換するために使用します。 現在 Visual Basic のすべての文字列は Unicode で、LenB はサポートされていません。

スマート デバイス開発者のためのメモ

Len 関数は、String 変数と Object 変数だけをパラメーターとして受け入れます。 Object に文字列型 (String) が含まれる場合は、String の長さを返します。 パラメーターが NULL Object 参照である場合は、ゼロを返します。 Object にその他の型が含まれる場合は、例外がスローされます。

Len 関数を使って文字列の文字数を返す例を次に示します。

Visual Basic
' Initializes variable.
Dim TestString As String = "Hello World"
' Returns 11.
Dim TestLen As Integer = Len(TestString)

.NET Framework

サポート対象: 4、3.5、3.0、2.0、1.1、1.0

.NET Framework Client Profile

サポート対象: 4、3.5 SP1

Windows 7, Windows Vista SP1 以降, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core はサポート対象外), Windows Server 2008 R2 (SP1 以降で Server Core をサポート), Windows Server 2003 SP2

.NET Framework では、各プラットフォームのすべてのバージョンはサポートしていません。 サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
コミュニティ コンテンツ   コミュニティ コンテンツとは
新しいコンテンツの追加 RSS  注釈
Processing
© 2012 Microsoft. All rights reserved. 使用条件 | 商標 | プライバシー
Page view tracker