You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to Scala version 2.10.0-M3 (JavaHotSpot(TM) 64-BitServerVM, Java1.6.0_29).
Type in expressions to have them evaluated.
Type:help for more information.
scala>:paste
// Entering paste mode (ctrl-D to finish)importscala.collection.mutable.Mapimportscala.collection.mutable.ListBuffervalappleHolder=Map[String,ListBuffer[AnyRef]]()
valandString="apple=all&apple=123"for (param <- andString.split('&')){
valtempSplit= param.split('=')
appleHolder.get(tempSplit(0)) match{
caseSome(x) => x += tempSplit(1)
caseNone=> appleHolder += tempSplit(0) ->ListBuffer[AnyRef](tempSplit(1))
}
}
// Exiting paste mode, now interpreting.importscala.collection.mutable.Mapimportscala.collection.mutable.ListBuffer
appleHolder: scala.collection.mutable.Map[String,scala.collection.mutable.ListBuffer[AnyRef]] =Map(apple ->ListBuffer(all, 123))
andString:String= apple=all&apple=123
When trying to run the below code you are presented with an error:
========================================================================================================
changing the case for None to the below is a workaround
The text was updated successfully, but these errors were encountered: