Use params to mark parameter : params : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » params »

 

Use params to mark parameter








    
 

using System;

class ParamsSample {
    static void PrintStrings(params String[] StringArray) {
        for (int i = 0; i < StringArray.Length; i++)
            Console.Write("{0} ", StringArray[i]);

        Console.WriteLine();
    }

    static void Main(String[] args) {
        String names = "K";
        PrintStrings("A");
        PrintStrings(names, "R", "S");
        PrintStrings("R", "E", "C", "S");
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» params