I need a C# function that will convert from one row format to another?
<p>I have to do following kind of conversions where my source string can have one or two periods and where each number is represented by two digits. So a "1" becomes "01" and a "90" becomes "90". Here's an example of the before -> after</p>

<pre><code>0.0 -&gt; 0000
1.1 -&gt; 0101
10.10 -&gt; 1010
1.88 -&gt; 0188
1.11.22 -&gt; 011122
33.44.5 -&gt; 334405
</code></pre>

<p>I have the following function but it does work for the different combinations. Can anyone suggest how I can make it work for the case where there are <strong>1 or 2</strong> periods in my input:</p>

<pre><code>    public string DotFormatToRowKey(string tempRowKey) {
        return string.Join("", from s in id.Split('.')
                               select s.PadLeft(2, '0')).PadRight(4, '0'));
    }
</code></pre>
