kotlin

kotlin

Kotlin program to convert one string to character array

In this kotlin tutorial, we will learn how to convert one string to a character array. Kotlin provides one method called toCharArray that can be used to convert one string to character array.

Read
kotlin

Kotlin program to delete all files in a folder

In Kotlin, you don't have to iterate through all files in a folder and delete the files one by one. Kotlin comes with an inbuilt File method called deleteRecursively that can be used to delete all files in a folder. In this post, I will show you how to use deleteRecursively with an example.

Read
kotlin

Convert Java file to Kotlin in Intellij Idea

You can use both Kotlin and Java files in a Kotlin program. Like if you want to move your Android project from Java to Kotlin, you can do that. You can add new files as kotlin files. Or, you can convert your existing Java files as well.

Read
kotlin

Kotlin program to decapitalize the first character of a string

In this post, I will show you two different ways to decapitalize the first character of a string. For example, if the string is 'TWELVE', it will change it to 'tWELVE'.

Read
kotlin

Kotlin program to get binary representation of integer

Kotlin program to get the binary representation of an integer value. We have two different ways to find out the binary representation of an integer value. Let me show you how :.

Read
kotlin

Kotlin sortedBy method example

Kotlin sortedBy is useful to sort collection items. You can use it to sort items in natural order or by using a selector function. It returns a list of all elements sorted. In this quick example, I will show you how to use sortedBy with examples.

Read
kotlin

Python program to print the current installed version

In almost all programming languages, sometimes, you might have to check the current installed version. For example, if you are using one python method that is available only to a specific version and above, it is a good practice to add one fallback option, i.e. check if the current installed python version is equal or greater to that required version or not.

Read
kotlin

Kotlin string slice method example

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 :.

Read
kotlin

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
kotlin

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