Skip to content

Convert null value into string variable

Priya M

Asked Jan 22, 2016, 12:06 AM EST1 answer
Share
LinkedInX
How to convert the null value variable to string variable.
 
Give Example.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Code
    string output = string.Empty;
    int? value = null;
    output = value.HasValue?Convert.ToString(value):string.Empty;
    0