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.
ReadIn 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.
ReadYou 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.
ReadIn 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'.
ReadKotlin 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 :.
ReadKotlin 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.
ReadIn 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.
ReadKotlin 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 :.
ReadKotlin 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'.
ReadString 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