RosettaCodeData/Task/Empty-string/Scala/empty-string.scala
2023-07-01 13:44:08 -04:00

10 lines
239 B
Scala

// assign empty string to a variable
val s=""
// check that string is empty
s.isEmpty // true
s=="" // true
s.size==0 // true
// check that string is not empty
s.nonEmpty // false
s!="" // false
s.size>0 // false