wes d2a2ba9e15 first commit 4 年 前
..
README.md d2a2ba9e15 first commit 4 年 前
code.cpp d2a2ba9e15 first commit 4 年 前
unitTest.cpp d2a2ba9e15 first commit 4 年 前

README.md

Retrieve the Subreddit

by Helen Yu tags: strings, regex

Summary

Create a function to extract the name of the subreddit from its URL. Examples subReddit("https://www.reddit.com/r/funny/") ➞ "funny" subReddit("https://www.reddit.com/r/relationships/") ➞ "relationships" subReddit("https://www.reddit.com/r/mildlyinteresting/") ➞ "mildlyinteresting" Notes N/A

Instructions

Create a function to extract the name of the subreddit from its URL.

Examples

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

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

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

Notes

N/A