Kotlin stdlib comes with one class called KotlinVersion, that provides different properties to check the current Kotlin version runtime.
ReadIn Kotlin, we can define a class member as private, internal, public or protected. These are also called visibility modifiers. It defines the scope from where we can access a member.
ReadWe have a couple of different ways to read the file content in Kotlin. For these examples, we have created one readme.md file with the below content :.
ReadDouble equal "==" and triple equal "===" are used for equality check in Kotlin. Both are different and not exactly same as like Java. In this post, we will see how these equal check works.
ReadIn this post, I will show you different ways to convert a string to number in Kotlin. This problem has a lot of use cases like your application is getting string values from the server and you want to convert it to number safely before processing. Or you want to convert the user input value to number before sending to the server. Let's check the programs :.
ReadWe have a couple of different ways to generate random numbers in Java. Starting from Kotlin 1.3, one new package kotlin.random was introduced for a pseudo-random generation. So, if your project is using 1.3 or later Kotlin version, you can use this package.
ReadIn this Kotlin programming tutorial, I will show you different ways to capitalize the first letter of each words in a string. We can't modify a string as it is immutable. We will create one new string from the original string. a sentence
ReadIn this post, I will show you two different ways to capitalize the first character of a string. If the input string is "hello", it should print "Hello".
ReadIn this tutorial, we will learn how to remove all special characters from a string in Kotlin. Our program will remove all non-alphanumeric characters excluding space. For example, if the string is abc 123 *&^, it will print abc 123.
ReadSometimes we need to convert one character array to a String. For example, if the array is ['a','b','c','d','e'], we may need to convert it to string abcde or a-b-c-d-e etc. It is pretty easy in kotlin to convert one character array to string. In this tutorial, I will show you two different ways to do that.
Read