Kotlin文字列contains
substring

contains文字列

startsWith

指定した文字列を含むか確認します。

構文

str.contains(other)

使用例

下記の値を入力するとサンプルに即時反映されます。

println
contains
println("Hello".contains("ell")) // true