- Implementing functionality as a "Service" would be an overkill. To keep it simple I decided to use "static class" pattern.
- No need to UnitTest MVC controllers. Some UI oriented tests cound be introduced, or a BDD tests using SpecFlow.
- Spend no longer than three hours on this problem.
- Write the code in your usual style using C#.
- Do not use external functionality to directly solve the problem – in particular do not use the built-in C# String class methods to find matches or substrings, for example the lastIndexOf() method, Regex libraries, Linq or similar. You may however hold Strings while your own algorithm does the matching.
- Write an MVC application that fulfils the following requirements
- Accepts two strings as input parameters: one string is called “text” and the other is called “subtext” in this problem statement.
- The application matches the subtext against the text, outputting the character positions of the beginning of each match for the subtext within the text.
- Multiple matches are possible.
- Matching is case insensitive.
- The application should be called “TextMatch”
- The results/output text should only contain the character positions with a comma between each position. No spaces or other formatting should be returned.
- The matches should be displayed within the MVC app.
Input text is "Polly put the kettle on, polly put the kettle on, polly put the kettle on we’ll all have tea"
Subtext: Polly
Output: 1, 26, 51
Subtext: Polly
Output: 1, 26, 51
Subtext: ll (ell ell)
Output: 3, 28, 53, 78, 82
Subtext: X
Output: There is no output
Subtext: Polx
Output: There is no output
Your code will be assessed as if it was a commercial application. Your submission should include a Visual studio solution of your program.