How do you find strings in Kotlin?

To check if a string contains specified string in Kotlin, use String. contains() method . Given a string str1 , and if we would like to check if the string str2 is present in the string str1 , call contains() method on string str1 and pass the the string str2 as argument to the method as shown below.

Sizin İçin Seçtik  How do I add an element to an array in Kotlin?

Leave a Reply

Your email address will not be published. Required fields are marked *