mercredi 6 mai 2015

Generate alphanumeric string

I need some test company-names, like "rnd_company_blah23haf9", "rnd_company_g356fhg57" etc.

Is it possible to do something like

import scala.util.Random
val company = s"rnd_company_${Random.alphanumeric take 10 ?????}"

provided someone can fill out ????? of course.




Aucun commentaire:

Enregistrer un commentaire