how to splve this question
-
Given a string Str and a character C, your task is to remove the first and last occurrence of the character C from the string Str.
Input Format
• First line of input consists of a string value, denoting str
Second line of input consists of a character denoting C
Constraints
• 1 <= str.length <=100
Output Format
• Print the string after the above operation
Sample Input
codedecode
Sample Output
coddecod
-
Given a string Str and a character C, your task is to remove the first and last occurrence of the character C from the string Str.
Input Format
• First line of input consists of a string value, denoting str
Second line of input consists of a character denoting C
Constraints
• 1 <= str.length <=100
Output Format
• Print the string after the above operation
Sample Input
codedecode
Sample Output
coddecod
- You have posted this in the forum for discussing bugs and suggestions for the CodeProject site itself. 2) You have also already posted this in QA: How to solve this question[^] 3) Nobody here is going to do your homework for you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer