TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
paulwhittaker99
NA
3
0
Using the generic type 'System.Collections.Generic.IEnumerable
' requires '1' type arguments
Oct 12 2010 5:10 AM
Hi There
I'm getting the above error message for this block of code - I've bolded the line in question, can anyone tell what I'm missing? Thanks very much in advance, Paul.
internal class GroupIterator : IEnumerable
{
private Regex _regex;
private string _input;
public GroupIterator(string input, string pattern)
{
_regex = new Regex(pattern, UserDefinedFunctions.Options);
_input = input;
}
public IEnumerator GetEnumerator()
{
int index = 0;
Match current = null;
string[] names = _regex.GetGroupNames();
do
{
index++;
current = (current == null) ?
_regex.Match(_input) : current.NextMatch();
if (current.Success)
{
foreach (string name in names)
{
Group group = current.Groups[name];
if (group.Success)
{
yield return new GroupNode(
index, name, group.Value);
}
}
}
}
while (current.Success);
}
}
Reply
Answers (
1
)
multilayer programming insert problem
Executing script in sql server using c# code