This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.
I was doing my homework today(yes I am aware I should be enjoying myself on 30th December) and had some problems with concatenating possibly null strings in LINQ . Quick trip to StackOverflow and I find out C# has some funky operators that solve this in a (sort-of) clean way. 1 var outputString = input1 ?? '' + input2 ?? '' ; I like type inference so I use var’s extensively - please…
I was doing my homework
today(yes I am aware I should be enjoying myself on 30th December) and had some problems
with concatenating possibly
null strings in
LINQ.
Quick trip to
StackOverflow and I find
out
C#
has some funky operators that solve this in a (sort-of) clean way.
1
|
var outputString = input1 ?? "" + input2 ?? "";
|
I like type
inference
so I use var’s extensively - please don’t judge me. What this does is
concatenate input1 and input2 substituting null values with empty
string. In
scala you would write something like
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.