Hello,

I have a string x which is either null or has some value. I have to assign this value to another string y. With normal '=' (y = x) operation, I get an error if string x has null value.

I have to check first with the help of "if" statement

Code:
if(x != "")    //or catch exception here
    y = x;
I have to apply above code in my program everywhere I try to assign one string value to another string (and have to be careful). I would have preferably overloaded '=' operator, but have just leant that it is not possible to overlaod '='.

Can someone please suggest me another way of doing it?

Regards
Ricky