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 ?

0

3 Answers 3

4

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

You can try using "null" character:

char empty = '\0';
Sign up to request clarification or add additional context in comments.

1 Comment

Sorry posted this before noticing the duplicate.
4

You can use for identifying empty char:

default(Char)

Comments

2

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

char? c = null;

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.