In C#, how do you create methods that append to variables?
<p>I've searched around for the answer to this many times, but I don't know what this type of method is called, so my searches ended up useless, nor can I explain it to the search engine.</p>

<p>How do you make a method that uses the variable it is appended to as it's parameter (like "myVariable**.ToString()**)?"</p>

<p>.ToString() works on any variable I append it to, and uses the variable behind it as a parameter, rather than entering the parameter within the brackets... An example of what I want to do would be:</p>

<pre><code>    private void OpenExcel(string inFileName)
    {
        Excel.Application xlApp = new Excel.ApplicationClass();
        Excel.Workbook xlBook = xlApp.Workbooks.Open(inFileName
            , Type.Missing, Type.Missing, Type.Missing, Type.Missing
            , Type.Missing, Type.Missing, Type.Missing, Type.Missing
            , Type.Missing, Type.Missing, Type.Missing, Type.Missing
            , Type.Missing, Type.Missing);
        Excel.Worksheet xlSheet = (Excel.Worksheet)xlBook.Worksheets[1];

        xlApp.Quit();
        xlApp.releaseObject();
    }

    private void releaseObject(object obj)
    {
        try
        {
            System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
            obj = null;
        }
        catch (Exception)
        {
            obj = null;
        }
        finally
        {
            GC.Collect();
        }
    }
</code></pre>

<p>I know this is kind of a stupid example, but it shows what I want to do with the "xlApp.releaseObject()".</p>

<p>Also... Can someone please tell me what that kind of method (or type of call, whatever it is) is called? I hate not knowing.</p>
