How to print a part of char arr in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] arr = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g' };

            Console.WriteLine(arr, 2, 4);
        }
    }
}

/*
run:
  
cdef

*/

 



answered Jan 13, 2017 by avibootz
...