String.Chars プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

プロパティ値
Unicode 文字。


index パラメータは、インデックス番号が 0 から始まります。
このプロパティは、index パラメータで指定された位置の Char を返します。ただし、1 つの Unicode 文字が 1 つ以上の Char で表されることがあります。おのおのの Char ではなくおのおのの Unicode 文字を対象に処理を行うには、System.Globalization.StringInfo クラスを使用します。

文字列を検証するルーチンでこのインデクサを使用する方法については、次のコード例を参照してください。
Console.Write("Type a string : ") Dim myString As String = Console.ReadLine() Dim i As Integer For i = 0 To myString.Length - 1 If Uri.IsHexDigit(myString.Chars(i)) Then Console.WriteLine("{0} is a hexadecimal digit.", myString.Chars(i)) Else Console.WriteLine("{0} is not a hexadecimal digit.", myString.Chars(i)) End If
Console.Write("Type a string : "); string myString = Console.ReadLine(); for (int i = 0; i < myString.Length; i ++) if(Uri.IsHexDigit(myString[i])) Console.WriteLine("{0} is a hexadecimal digit.", myString[i]); else Console.WriteLine("{0} is not a hexadecimal digit.", myString[i]);
Console::Write( "Type a string : " ); String^ myString = Console::ReadLine(); for ( int i = 0; i < myString->Length; i++ ) if ( Uri::IsHexDigit( myString[ i ] ) ) Console::WriteLine( "{0} is a hexadecimal digit.", myString[ i ] ); else Console::WriteLine( "{0} is not a hexadecimal digit.", myString[ i ] );

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からString.Chars プロパティを検索する場合は、下記のリンクをクリックしてください。

- String.Chars プロパティのページへのリンク