scala - How to return an option when reading a vector -


Reading from a vector, I do not want to return anything while trying to read an index, which is not anything else Is there any standard way to do this?

you lift :

  val V = Vector (1, 2, 3) v.lift (0) // some (1) v.lift (5) // none  

for any partial function Note the work.


Comments

Popular posts from this blog

Active Directory Authenticated Proxy Server with Squid or CNTLM -

java - @PluginTarget(Node.class) not registering as neo4j plugin -

python - Calculate STD manually using Groupby Pandas DataFrame -