How to check if character is letter in Scala

1 Answer

0 votes
object Main extends App {
  val ch = 'a'

  if (ch.isLetter) {
    println("yes")
  } else {
    println("no")
  }
}

 
 
/*
run:
   
yes
 
*/

 



answered Jan 2, 2025 by avibootz
...