diff --git a/url_manipulation.c b/url_manipulation.c new file mode 100644 index 0000000..28a517b --- /dev/null +++ b/url_manipulation.c @@ -0,0 +1,37 @@ +#include +#include + +char* url_to_proto(char* url) { + size_t length = strlen(url); + int sentinel = 0; + char* to_return = malloc(sizeof(char) * 10); + for (int i=0;i + +/* url_to_proto - This takes in a URL, and returns the protocol. +Example - 'https://example.org' would return 'https'. */ + +char* url_to_proto(char* url); + +/* url_to_hostname - This takes in a URL, and returns the hostname. +Example - 'https://example.org' would return 'example.org'. */ + +char* url_to_hostname(char* url); +