KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
It's quite annoying to test all my strings for null before I can safely apply methods like ToUpper() , StartWith() etc... If the default value of string were the empty string, I would not have to test, and I would feel it to be more consistent with the other value types like int or double for example. Additionally Nullable<String> would make sense. So why did the designers of C# choose to use null as the default value of strings? Note: This relates to this question , but is more focused on the why instead of what to do with it.
Tags (comma-separated)
Save Edits
Cancel