Last active
December 31, 2015 01:49
-
-
Save jewer/7916530 to your computer and use it in GitHub Desktop.
Scala to (naively) parse base64 encoded querystring values (which include '=' characters)
This file contains hidden or 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
| def expandQueryString(s: String) : Array[(String, String)] = | |
| s.split("\\?").last.split("&").map(_.split("=", -1)) | |
| .map(x =>{ | |
| if(x.length > 1) Some(x.head, x.tail.mkString("=")) | |
| else None | |
| }).flatten | |
| .filterNot(_._2 == "") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment