I'm afraid that voids cannot return anything, hence why they are called 'voids' - 'void' is a fancy word that means 'nothing' or 'empty' in English.
You can always try using an
out
, like this:
string test = "Starting Value"
Console.WriteLine(test);
Modify(out test);
Console.WriteLine(test);
And the void
Modify
is defined like this:
void Modify(out string input)
{
input = "Modified Value";
}