fork download
  1. object HelloWorld {
  2. def main(args: Array[String]) {
  3. // val content = List("appointment_id", "appointment_date", "appointment_time", "appointment_location", "appointmnet_subject")
  4. // val types = List("String", "String", "String", "String", "String")
  5. // val converted = content.map(s => toCamelCase(s))
  6. // val mapObjs = (converted zip types).toMap
  7. //
  8. // val str = mapObjs.view map{
  9. // case (k, v) => k + ": " + v
  10. // } mkString("", ", \n", "")
  11. // println(str)
  12.  
  13. println(toCamelCase("appointment_id"))
  14. }
  15.  
  16. private def toUpperCamelCase(s: String): String = {
  17. val parts = s.split("_");
  18. var content = "";
  19. parts.foreach(a => content += toProperCase(a))
  20. content
  21. }
  22.  
  23. private def toCamelCase(s: String): String = {
  24. val parts = s.split("_");
  25. parts(0) + toProperCase(parts(1))
  26. }
  27.  
  28. private def toProperCase(s: String): String = {
  29. s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
  30. }
  31. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
spoj: The program compiled successfully, but Main.class was not found.
      Class Main should contain method: def main(args: Array[String]).
stdout
Standard output is empty