String.Chars-Eigenschaft
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Parameter
- index
- Typ: System.Int32
Eine Position in der aktuellen Zeichenfolge.
| Ausnahme | Bedingung |
|---|---|
| IndexOutOfRangeException |
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]); // The example produces output like the following: // Type a string : 3f5EaZ // 3 is a hexadecimal digit. // f is a hexadecimal digit. // 5 is a hexadecimal digit. // E is a hexadecimal digit. // a is a hexadecimal digit. // Z is not a hexadecimal digit.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core-Rolle wird nicht unterstützt), Windows Server 2008 R2 (Server Core-Rolle wird mit SP1 oder höher unterstützt; Itanium wird nicht unterstützt)
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.