Q:

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

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)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now