リンク先のURLが長いときれいに見えないので、ドメイン名のみ表示する方法を探していたところありました。
URL.parse("http://example.com/hogehoge/hogehoge/").host
=> example.com
参考
http://stackoverflow.com/questions/8855236/given-a-url-how-can-i-get-just-the-domain
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
リンク先のURLが長いときれいに見えないので、ドメイン名のみ表示する方法を探していたところありました。
URL.parse("http://example.com/hogehoge/hogehoge/").host
=> example.com
参考
http://stackoverflow.com/questions/8855236/given-a-url-how-can-i-get-just-the-domain
Register as a new user and use Qiita more conveniently
Go to list of users who liked