Set string color to Green

Report a typo

The function setStringToGreen() is called with a string parameter and returns the same string wrapped in two ANSI sequences. The first one – a 16-color ANSI sequence – sets the text color to Green, and the second one resets the colors to their default values. Example: "<set Green sequence><original string><reset sequence>".

Your task is to write the code for the setStringToGreen() function.

Write a program in Kotlin
fun setStringToGreen(str: String): String {
// Write your code here

//
}
___

Create a free account to access the full topic