View Single Post
Old 12-31-2012, 07:31 PM   PM User | #5
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
How it works:

First, we concat a '/' to the end of the URL, just in case there is none there already.

Then we replace 'http://' and 'https://' and 'www.' with nothing.

That gets us down to something like codingforums.com/gobbledygook/

So then we use LOCATE to find the first '/' in that (which MIGHT be the one we added at the first step).

And then we use SUBSTR to get all the characters up to but not including that first '/'.

Make sense?
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote