d-feverx
d-feverx

Reputation: 1672

How to check a string starts with a specified string in kotlin?

I want to check a string is starting with a particular string or not, how can check that in kotlin

Upvotes: 3

Views: 7639

Answers (1)

Mark Bramnik
Mark Bramnik

Reputation: 42441

   val s = "hello"
   println(s.startsWith("hel")) // true
   println(s.startsWith("hal")) // false

Upvotes: 10

Related Questions