Skip to content

Instantly share code, notes, and snippets.

@jewer
Last active December 31, 2015 01:49
Show Gist options
  • Select an option

  • Save jewer/7916530 to your computer and use it in GitHub Desktop.

Select an option

Save jewer/7916530 to your computer and use it in GitHub Desktop.
Scala to (naively) parse base64 encoded querystring values (which include '=' 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