C#: Insert a substring before the first occurrence of a string
Write a program in C# Sharp to insert a substring before the first occurrence of a string.

Sample Solution:-
C# Sharp Code:
Sample Output:
Insert a substing before the first occurence of a string : -------------------------------------------------------------- Input the original string : The string is str Input the string to be searched for : string Input the string to be inserted : original The modified string is : The original string is str
Flowchart:

C# Sharp Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a program in C# Sharp to find the number of times a substring appears in the given string.
Next: Write a C# Sharp program to compare (less than, greater than, equal to ) two substrings.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.