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
C++

C++ program to find the sum of two numbers using friend function

How to find the sum of two numbers using friend function in C++. Learn what is a friend function in C++ and how to use a friend function to find the sum.

Read
C++

C++ program to find the volume of a cylinder in 3 different ways

3 different ways in C++ to find the volume of a cylinder. We will learn how to use user-input values to find the cylinder volume with three example programs.

Read
C++

C++ program to insert an element to an array at any position

C++ program to insert element to an array at the start, at the end and at any given specific position. We will learn how to do these with different example programs.

Read