Ok, so I am new to C Sharp and I have one function call which might send null values. I want to make sure that if its null then I should set those null as empty string. Below is what I have tried and it works but I think there must be an elegant way to achieve this.
public static Concat ()
{
// imagine x = null and y = null
Abc( x, y);
}
public static Abc ( string x , string y)
{
// blah blah
x = x ?? "";
y = y ?? "";
efg( x, y);
}
I looked into this Solution but I could not understand it. Can I do something in the Abc arguments/parameter
itself. I mean
public static Abc ( string x Can I do something here , string y Can I do something here)
{
// blah blah
x = x ?? "";
y = y ?? "";
efg( x, y);
}