The ?? operator defines the default value to be returned when a nullable type is assigned to a non-nullable type.
// Set defaultValue to Settings.DefaultValue unless it is null // in which case set it to string.Empty string defaultValue = Settings.DefaultValue ?? string.Empty;
No comments:
Post a Comment