I want to return a List from the following code:
private List<string> tokenizer(string x)
.........
..........
i has done thank you
I tried to use
.ToList();
but it didn't work. can anyone help? thanks.
I will take a shot at this. Is this what your after?
var list = from s in Regex.Split(sb.ToString(), "([ \\t{}()\n])")
where s.Length > 3 && !exclude.IsMatch(s)
select s.Replace("!", "@")).ToList()
Then you can return it:
return list;
If this isn't what you are trying to do please provide more details.
Is this what you want?
return new List<String>(
from s in Regex.Split(sb.ToString(), "([ \\t{}()\n])")
where s.Length > 3 && !exclude.IsMatch(s)
select s.Replace("!", "@"));
Not sure why you're joining the strings together if you want the list of cleaned up text.
string.Joincreates a single string.