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!"
CharSequence
Step by step
Report a typo
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
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.