Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string s = null;
- if (null != myObject)
- {
- s = myObject.propertyName;
- }
- string result = obj?.ToString();
- string result = obj != null ? obj.ToString() : null;
- string s = myObject == null ? null : myObject.PropertyName;
- if (value != null)
- {
- return value;
- }
- else
- {
- return otherValue;
- }
- return value != null ? value : otherValue;
- return value ?? otherValue;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement