Skip to content

Update Bots.cs#6

Merged
ORelio merged 1 commit intoMCCTeam:Indevfrom
dogwatch:patch-2
Jul 20, 2013
Merged

Update Bots.cs#6
ORelio merged 1 commit intoMCCTeam:Indevfrom
dogwatch:patch-2

Conversation

@dogwatch
Copy link
Contributor

No description provided.

@ORelio
Copy link
Member

ORelio commented Jul 20, 2013

Question: Always wondered, why using IsNullOrEmpty is better than comparing to an empty string ?

  • if (String.IsNullOrEmpty(username))
  • if (username == "")

@dogwatch
Copy link
Contributor Author

public static bool IsNullOrEmpty(string value) {
return value == null || value.Length == 0;
}

@featherbear
Copy link

@dogwatch that doesn't really answer the question.

@featherbear
Copy link

@ORelio
Copy link
Member

ORelio commented Jul 20, 2013

OK, why not. Merging you code optimizations :)
EDIT: Thanks bearbear for the explanation

ORelio added a commit that referenced this pull request Jul 20, 2013
@ORelio ORelio merged commit e31866f into MCCTeam:Indev Jul 20, 2013
@featherbear
Copy link

Its not my explanation,just googled it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants