How to return a string from a method

Use:

public string myvoid(string key, bool data)
{
    return key + " = " + data;
}

Also, your method shouldn’t be called myvoid any more since it actually returns a value. Something like FormatValue would be better.

Leave a Comment