Sample for String.ToCharArray(Int32, Int32) : String Split Join « String « C# / CSharp Tutorial






using System;

class Sample {
    public static void Main() {
    string str = "012wxyz789";
    char[] arr;

    arr = str.ToCharArray(3, 4);
    Console.Write("The letters in '{0}' are: '", str);
    Console.Write(arr);
    Console.WriteLine("'");
    Console.WriteLine("Each letter in '{0}' is:", str);
    foreach (char c in arr)
        Console.WriteLine(c);
    }
}








5.19.String Split Join
5.19.1.Joining strings
5.19.2.Splitting strings by |
5.19.3.Split strings by three tokens
5.19.4.String joins
5.19.5.Tokenize strings
5.19.6.String Split
5.19.7.Split string with \\
5.19.8.Sample for String.ToCharArray(Int32, Int32)