c# - Is there an easier way of passing a group of variables as an array -
What am I trying to do, my stream driver, for instance, instead of writing a dedicated method, to use it at random Instead of the program it moves the point where it is called a square because there are some bugs in the present way.
What do I have at this time here:
write public static void (string [] stringwowrite) {author = new streamer (stream); Writer.Write ("Hello"); Foreach (type strows in string string stroke) {author.Write ("+" string stroke + ""); } Author. Flush (); }
Note: Stream is an example of a TCP client
With this I am capable of crossing an array of variables to write, but I use it Can not call the same method as the existing method:
Authors. WrightLine ("Hello {0} {1} {2}", Variable 1, Variable 2, Variable 3); Writer.flush ();
It would be great if I was able to pass the X number of variables in the method and for this to loop to write each of them in this focus, however, optional in .NET Access the parameter V4.0 which is still in beta.
Any thoughts?
You can take a look at this:
public stable Write zero (parameter string [] string octroit) {foreach (strowwrite in string string strings) {author.Write ("+ + stringToWrite +" ");} ...}
use same Then, what you want.
Comments
Post a Comment