string studentHobbies = (txtHobbies.Text != null) ? txtHobbies.Text : string.Empty;
can be written smartly using null-coalescing operator (??) as-
string studentHobbies = txtHobbies.Text ?? string.Empty;
Happy Coding :)
string studentHobbies = (txtHobbies.Text != null) ? txtHobbies.Text : string.Empty;
string studentHobbies = txtHobbies.Text ?? string.Empty;
0 comments :
Post a Comment