This seems stupid - must be me!
Say I had a string filter["size]" = "g1g" this actually reads "greater" "1" "gb"
so
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
first and last are both boolean.
I then set x (cos I was getting stroppy) to length of filter["size"] which is a string.
However, I've come to copy the final number(s) in the middle.
Int64.Parse(filter["size"].Substring(first?1:0,last?(first?x-2:x-1):x));
And it doesnt like the nested inline ifs..
Substring(first?1:0,last?(first?x-2:x-1)); complains that its missing the :, which is right, but the instant you add it it complains
Error 1 The best overloaded method match for 'string.Substring(int, int)' has some invalid arguments
Im beginning to think I should just have parsed it with regexpr, but now Im curious as to why this isnt working.
So, irrelevant of there could be a ton of better ways, can anyone tell me why these nested inline ifs dont work?
x.:, but then you don't explain what you add. For example, if you add: nullthen you'll get the error you describe. Post the rest of your code!xandfirstare (isxjust anint, or a nullableint?). If you refactored your code out to multiple lines, you would be able to tell precisely which part of your code is the problem.