0

Possible Duplicate:
Why is there no Char.Empty like String.Empty?

I want to pass an empty char as a method parameter and I was wondering why I cannot say

char.Empty

while C# allows me to specify string.Empty ?

If not do I have '' as the only option ?

Community
  • 1
  • 1
pencilCake
  • 51,323
  • 85
  • 226
  • 363

3 Answers3

4

There is no empty char same way there is no empty number.

You can try using "null" character:

char empty = '\0';
Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
4

You can use for identifying empty char:

default(Char)
Samich
  • 29,157
  • 6
  • 68
  • 77
2

There is no such thing as an empty char. You would need to use nullable types to introduce that concept.

char? c = null;
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490