Answer: Write below query to get only website name
declare @Url as nvarchar(1000) = 'http://www.dotnetfunda.com/interviews/postexamquestion.aspx?';
select substring(replace(@Url,'http://www.',''),0,charindex('/',replace(@Url,'http://www.',''))) as [Website Only]
Output:-
dotnetfunda.com
Asked In: Many Interviews |
Alert Moderator