Obtenha o subreddit

Published by Helen Yu in

Crie uma função para extrair o nome do subreddit da sua URL.

Exemplos

sub_reddit("https://www.reddit.com/r/funny/") ➞ "funny"

sub_reddit("https://www.reddit.com/r/relationships/") ➞ "relationships"

sub_reddit("https://www.reddit.com/r/mildlyinteresting/") ➞ "mildlyinteresting"

Notas

N/A