Q:

Write a program in Kotlin to replace is with was respectively in given string

belongs to collection: Kotlin programming Exercises

0

Write a program in Kotlin to replace is with was respectively in given string

He is cryling ver loud.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution:

fun main(args : Array<String>)  {  
	var a = "He is cryling very loud."
	val s = "${a.replace("is", "was")}"
	println(s)
}

Output:

He was cryling very loud.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a program in Kotlin to get length of the giv... >>
<< Write a program in kotlin to map the following ...