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.
Readzip 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.
ReadKotlin 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.
ReadKotlin 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.
ReadIn 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.
ReadConverting 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.
ReadThis 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"].
ReadIn 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.
ReadIn this Kotlin programming tutorial, we will learn how to find one element in a list of objects. Kotlin provides different ways to find values in a list. We will explore these with examples.
ReadKotlin provides one method called indexOfFirst that returns the index of the first element of an iterable or list. In this tutorial, I will show you how to use this method with different examples.
Read