3
Reply

Instantiation of a class to initialize fields...

S

S

Aug 28 2012 1:00 PM
1.3k
Hi

Given code like the following:-

URL info = new URL("http://www.domain.com:80/info/");

The string "http://www.domain.com:80/info/" I know would be stored in a field and then accessed via an auto property like so

var getHost = info.Host;        // www.domain.com

But how would the property "Host" or more importantly the underlining field split the string. I assume the logic to do this would be in the property itself?

Regards
Steven

Answers (3)