Step by step

Report a typo

Write a function that takes in a CharSequence and returns a new CharSequence with every other character of the original one removed. For example, if the input is "Hello, world!", the output should be "Hlo ol!"

Sample Input 1:

Hello, world!

Sample Output 1:

Hlo ol!
Write a program in Kotlin
fun removeEveryOtherChar(input: CharSequence): CharSequence {
// write your code here
return sb
}
___

Create a free account to access the full topic