Computer Science, asked by nirmalareddy112, 1 month ago

write a Java program to find a string (passed as input2 to the function) and replace it another string (passed as input 3 to the function) in a given paragraph (passed as input1 to the function) and return the new paragraph.in case the string is not found, return the original paragraph. ​

Answers

Answered by ashfaq9938
0

Answer:

Given a string, a character, and a count, the task is to print the string after the specified character has occurred count number of times. Print “Empty string” in case of any unsatisfying conditions. (Given character is not present, or present but less than given count, or given count completes on last index). If given count is 0, then given character doesn’t matter, just print the whole string.

Examples:  

 

Input  :  str = "This is demo string"  

         char = i,    

         count = 3

Output :  ng

Input :  str = "geeksforgeeks"

        char = e,  

        count = 2

Output : ksforgeeks

Explanation:

pls mark as brainlist

Similar questions