Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions

Program Discussion :: Strings

Home > Programs > Strings

49 / 59

Given a string, say sentence=" this is crazy and fun" and a list, say name=["is", "fun"]. Now you need to capitalize on the first letter of every word in the given string which is not present in the list.

Answer:

fun getCapitalizeString(sentence: String) {
    val splitedList: List = sentence.split(" ")
    val checkList = listOf("is" , "fun")

    for (i in splitedList) {
        if (i != checkList[0]

Asked In :: Nagarro HackerRank

Post Your Answer Here:

Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here: