3 April 2014

String.Split using C#

class Program
    {
        static void Main(string[] args)
        {
            string strTestString = "Sample-C#.Net-string-handling-code";
            char[] chrSep = new char[] { '-' };
            foreach (string strRes in strTestString.Split(chrSep))
                Console.WriteLine(strRes);
            Console.ReadKey();

        }
    }

No comments:

Post a Comment