Kotlin program to concat one string and integer

Kotlin program to concat one string and one integer value. For example, if the string is 'hello-' and number is 20, it will print 'hello-20'.

Read

How to concatenate strings in Kotlin

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.

Read

Kotlin program to remove first and last characters of a string

Kotlin provides different methods to manipulate a string. In this post, we will learn different Kotlin string methods to remove the first and last characters of a string.

Read

zip and unzip methods in Kotlin array

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 not included in the final list.

Read

Kotlin program to find the sum of all numbers of an array

Kotlin program to find the sum of all numbers in an array. One number array is given and we need to find out the sum of its numbers.

Read

Different ways to get substring in a string in Kotlin

Kotlin string comes with different utility methods to extract one substring. These utility methods or extensions functions are better than what Java provides and they can get you substrings based on different conditions. In this post, I will show you how to use these Kotlin substring extension functions with examples.

Read

Different ways to find the length of a string in Kotlin

In this tutorial, we will learn different ways to find the length of a string. Actually you can use string property length that gives the length of a string in Kotlin. I am showing you three different ways. But I would recommend you to use length.

Read

Kotlin program to convert one list to string

Converting one list to string in Kotlin is easy. Kotlin provides one method to do that easily. It is called joinToString. In this post, I will show you how we can convert one list to string in Kotlin using joinToString with examples.

Read

Kotlin program to convert one comma separated string to list

This tutorial will show you how to convert one comma separated strings to a list in Kotlin. Each word in the list will be one item of the list. For example, if the string is Hello, World, it will put both words in a list like ["Hello", "World"].

Read

Kotlin program to check if an array contains any one of multiple values

In this tutorial, we will learn how to check if an array contains any one or another value in Kotlin. For example, if the array is 1, 2, 3, 4, 6, 8, if we check if it contains 1 or 3, then it should return true. Again, for the same array, if we check if it contains 10 or 11, it should return false because neither of these numbers exists in the array.

Read