|
-
May 9th, 2012, 11:41 AM
#1
[RESOLVED] string to list c#
I'm trying to convert a string to list<string> :
Code:
private List<string> removestopword(string input)
{
var Listtokens = from s in input.Split(' ')
where s.Length > 3 && !stopWordsList.Contains(s)
select s.ToList();
return Listtokens;
}
but it doesn't work . can anyone help? thanks
Last edited by falahjomor; May 9th, 2012 at 11:43 AM.
-
May 9th, 2012, 11:48 AM
#2
Re: string to list c#
Try replacing:
Code:
var Listtokens = from s in input.Split(' ')
where s.Length > 3 && !stopWordsList.Contains(s)
select s.ToList();
With:
Code:
var Listtokens = (from s in input.Split(' ')
where s.Length > 3 && !stopWordsList.Contains(s)
select s).ToList();
-
May 9th, 2012, 11:51 AM
#3
Re: string to list c#
 Originally Posted by Talikag
Try replacing:
Code:
var Listtokens = from s in input.Split(' ')
where s.Length > 3 && !stopWordsList.Contains(s)
select s.ToList();
With:
Code:
var Listtokens = (from s in input.Split(' ')
where s.Length > 3 && !stopWordsList.Contains(s)
select s).ToList();
it has done, thank you very much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|