Last active
March 30, 2018 23:46
-
-
Save CDRussell/4fb3b195c466716aa4ad7198496c9f51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun parse(url: String): ParsedData { | |
val result = URL_PARSE_REGEX.find(url) | |
if(result == null) { | |
// what do we do here? Throw an exception? Return null? | |
} | |
val mimeType = result.groupValues[2] | |
val data = result.groupValues[4] | |
return ParsedData(data, mimeType) | |
} | |
data class ParsedData( | |
val data: String, | |
val mimeType: String | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment