mercredi 4 mars 2015

How to get a string value from a method C#


Vote count:

0




so I'am trying to create a method where there's going to be a string value in it and then I want to get that value from the main method



public string test(string stringVar)
{
stringVar = "Hello world";
string anotherVar = stringVar;
return anotherVar;
}


For example in this code how can I get the variable 'anotherVar' to be recognized in the main method?


Thanks.



asked 1 min ago







How to get a string value from a method C#

Aucun commentaire:

Enregistrer un commentaire