How do you define a subdomain? Technically, in your example, cedric is a host name, not a subdomain. http://www.cedric.sample.com/ would make cedric a subdomain, and the host www resides in the domain cedric, which is a subdomain of sample in the top level domain of com.
So, do you need the host or the subdomain? Or the host name unless it's www?
In any case, there are plenty of string manipulation options to get you this. Might start at:
http://aspnet101.com/aspnet101/tutorials.aspx?id=5
The most straightforward way might be to strip the frist seven characters (http://):
Dim strURL as String
Dim strDomain as String
strURL = "http://cedric.sample.com"
strDomain = strUrl.SubString(7)
Then split the result at the periods:
arrDomainParts = strDomain.Split(".")
Dim strHostname as String
strHostname = arrDomainParts(0)
Of course, don't count on my code being correct, I type poorly and sometimes forget the syntax... :)
Jeff
Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.