import scala.util.matching.Regex val line = """James Gosling,Father of Java""" val re = """(.+),(.+)""".r line match { case re(name, fame) => print(name + " (" + fame + ")") case _ => // do nothing! }
View: All Posts; All Users | Get Bookmarklets Partner Sites: indiWiz.com | WizTools.org | WizTools.co.in © Subhash Chandran (subwiz [at] gmail [dot] com or Twitter: Ping for reporting problems and asking clarifications)