5

Print the string after the specified character has occurred given no. of times

 2 years ago
source link: https://www.geeksforgeeks.org/videos/print-the-string-after-the-specified-character-has-occurred-given-no-of-times/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Print the string after the specified character has occurred given no. of times

Print the string after the specified character has occurred given no. of times
  • 10 Views
  • 09/06/2022

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

Print the string after the specified character has occurred given no. of times: https://www.geeksforgeeks.org/print-string-specified-character-occurred-given-no-times/


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK