Nested conditional operators?
<p>This seems stupid - must be me!</p>

<p>Say I had a string <code>filter["size]" = "g1g"</code> this actually reads "greater" "1" "gb" </p>

<p>so</p>

<p>I've done a test to see if "first" character is a character, and work out its greater
I've done a test to see if "last" character is a character, and work out its gb, or mb, or whatever</p>

<p>first and last are both boolean.</p>

<p>I then set x (cos I was getting stroppy) to length of filter["size"] which is a string.</p>

<p>However, I've come to copy the final number(s) in the middle.</p>

<pre><code>Int64.Parse(filter["size"].Substring(first?1:0,last?(first?x-2:x-1):x));
</code></pre>

<p>And it doesnt like the nested inline ifs..</p>

<p><code>Substring(first?1:0,last?(first?x-2:x-1));</code> complains that its missing the :, which is right, but the instant you add it it complains </p>

<pre><code>Error   1   The best overloaded method match for 'string.Substring(int, int)' has some invalid arguments
</code></pre>

<p>Im beginning to think I should just have parsed it with regexpr, but now Im curious as to why this isnt working.</p>

<p>So, irrelevant of there could be a ton of better ways, can anyone tell me why these nested inline ifs dont work?    </p>
