Last post Oct 25, 2016 01:42 PM by PatriceSc
Oct 25, 2016 01:11 PM|vickyt5|LINK
I have a static string like shown below
public static void Decrypt(string text, out string retValue)
retValue = "this returns some string values";
Now I need to get this result in some other string.
string Result = Decrypt(encryptResult, out retValue);
Now what values should I pass in second parameter place. I'm confused and this doesn't work.
Oct 25, 2016 01:23 PM|senthilwaits|LINK
Decrypt(encryptResult, out retValue);
retValue will now have the result you expect
You can refer this fiddle
Oct 25, 2016 01:42 PM|PatriceSc|LINK
Look at the error message which could likely help. For now you are confusing using a function return value and providing a parameter that can be changed by the method you are calling.
So it could be rather :
public static string Decrypt(string text)
return "this returns some string values";
string Result = Decrypt(encryptResult);
is enough. senthilwaits already shown how to call what you defined so far.
When you return a single value or object using a function that returns a value is likely more frequently used.