C#: Search the position of a substring within a string
Write a program in C# Sharp to search for the position of a substring within a string.
Sample Solution:-
C# Sharp Code:
Sample Output:
Search the position of a substing within a string : ------------------------------------------------------- Input a String: Welcome to w3resource.com Input a substring to be found in the string: w3resource Found 'w3resource' in 'Welcome to w3resource.com' at position 11
Flowchart:
C# Sharp Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a program in C# Sharp to check the username and password.
Next: Write a program in C# Sharp to check whether a character is an alphabet and not and if so, go to check for the case.
What is the difficulty level of this exercise?
Based on 11 votes, average difficulty level of this exercise is Easy
.
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics