Is it possible to use Null value in string? [Resolved]

Posted by Gudevg under C# on 4/12/2012 | Points: 10 | Views : 859 | Status : [Member] | Replies : 7
Good day to all,

I would like to know solution for this. Is it possible to use whitespace or Null value in a string?

Regards,

Deepakkumar G.


Responses

Posted by: Kavi.Sirius on: 4/12/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
hi deepak,

u can use null value in string.
through the use of below method

string.IsNullOrEmpty()



Regards
Kavi.n

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/12/2012 [Member] Silver | Points: 50

Up
0
Down

Resolved
Hi Deeppakumar,

In string both are possible...

string s1 = " ";

string s2 = null;


here u can use s1, but not s2...
it throws NullException...
u can use after assign value for s2...

Regards,
Singaravel M

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/12/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks Kavi.n

Regarding Whitespace?


Regards,

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/12/2012 [Member] Starter | Points: 25

Up
0
Down
Okay Sakthi.


Regards & Thanks

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: arun_ymail-14946 on: 4/12/2012 [Member] Starter | Points: 25

Up
0
Down
You can use null value for string,
String newStr; //Null
String newStr1=string.empty; //blank
U can use white space also..


Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/12/2012 [Member] Silver | Points: 25

Up
0
Down
u r welcome..

if it is useful for ur question please "Mark as answer"

Regards,
Singaravel M

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kavi.Sirius on: 4/12/2012 [Member] Starter | Points: 25

Up
0
Down
welcome


Regards
Kavi.n

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response