Kotlin string slice method example

Introduction : Kotlin String class provides one method called slice to get one sub-string containing the characters defined by the method argument. It has two variants. In this post, I will show you how to use this method with examples :   public fun String.slice(indices: IntRange): String : It takes Read more…

Kotlin how to concatenate strings

How to concatenate strings in Kotlin

Introduction : String is immutable in Kotlin. If we concatenate two or more strings, it will generate one new string. We have different different ways to concatenate in Kotlin. In this tutorial, I will show you how to solve it with examples.   String plus method : String plus method Read more…

Kotlin zip and unzip array methods

zip and unzip methods in Kotlin array

Introduction : zip function builds one new list of paired elements from two existing arrays. Zipping transformation is useful to combine two array values. The final result is equal to the length of the smaller array if both arrays have different size. The extra elements of the larger array are Read more…