Return a lsit

What is wrong?
static List SubstringsFinder(string line, int m)
        {
            List<string> lineList = new List<string>();

            for (int i = 0; i < line.Length - m + 1; i++)
            {
                lineList.Add(line.Substring(i, m));
            }
            return lineList;
        }

Open in new window

zhshqzycAsked:
Who is Participating?
 
p_davisConnect With a Mentor Commented:
static List<String> SubstringsFinder(string line, int m)
        {
            List<string> lineList = new List<string>();

            for (int i = 0; i < line.Length - m + 1; i++)
            {
                lineList.Add(line.Substring(i, m));
            }
            return lineList;
        }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.