kotlin

kotlin

2 different Kotlin programs to find the root of quadratic equation

Learn how to find the roots of a quadratic equation in Kotlin in two different ways. We will use if-else conditions and when block to find the roots with user input values.

Read
kotlin

2 different ways to use Kotlin enum with string values

Learn how to use Kotlin enum with string values. We will learn two different ways how to create Kotlin enum from string values and how to search for Kotlin enum by string value.

Read
kotlin

Introduction to Kotlin string interpolation with examples

Learn what is interpolation of string in Kotlin with examples. We will learn how to use Kotlin interpolation with different types of variables and with functions.

Read
kotlin

How to convert a string to byte array in Kotlin

How to convert a string to byte array in Kotlin with examples. We can use the toByteArray method to convert a string to byte array. Learn how to use the toByteArray method with examples.

Read
kotlin

3 different ways to convert a byte array to string in Kotlin

3 ways to convert a byte array to string in Kotlin. This post will show you how to convert a byte array to string with UTF-8 encoding or a different encoding.

Read
kotlin

5 different examples to split a string in Kotlin

Different Kotlin examples to split a string. Learn how to split string with single delimiter, multiple delimiters, ignoring character case, with limit and with a regular expression.

Read
kotlin

How to compare two strings in Kotlin in different ways

Kotlin program to compare two strings in different ways. We will learn how to use comparison operator, equals method and compareTo method to compare two strings in Kotlin.

Read
kotlin

Check if a string ends with another string or character in Kotlin

Kotlin program to check if a string ends with another string or character. This program will show you how to use endsWith method in Kotlin with different examples.

Read
kotlin

Check if a string starts with a character or sub-string in Kotlin

Kotlin program to check if a string starts with a sub-string or character in different ways. We can use the startsWith method to check if a string starts with another string.

Read
kotlin

How to remove the first n characters from a string in Kotlin

Different ways in Kotlin to remove the first N characters from a string. We will learn how to remove the first N characters by using the drop method and removeRange method with example programs.

Read