C# Nullable to string

后端 未结 11 1887
挽巷
挽巷 2020-12-16 09:29

I have a DateTime? variable, sometimes the value is null, how can I return an empty string \"\" when the value is null or

11条回答
  •  心在旅途
    2020-12-16 10:04

    According to Microsoft's documentation:

    The text representation of the value of the current Nullable object if the HasValue property is true, or an empty string ("") if the HasValue property is false.

提交回复
热议问题