At the moment I'm doing something like:
public virtual String zipcodeRaw { get; set; }
public virtual String zipcode {
get
{
return zipcodeRaw.Trim();
}
}
Is there a way I can do something like:
public virtual String zipcode {
get
{
return zipcode.Trim();
}
}
That would give you an infinite loop since zipcode refers to itself. However, properties are just public accessors and modifiers for a private variable. You could certainly do:
private string _zipcode;
public virtual string zipcode {
get { return _zipcode.Trim(); }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With