If you remove the new line characters. you're not going to get:
name1
name2
You'll get:
name1 name2
Is that what you want?

Signature
Regards,
Fred Chateau
fchateauAtComcastDotNet
well,
the thing is I need to pass each name into a method so I can get their
information.
here is what I have.
I have a textbox that a user can enter names in, its a multiline textbox and
they can enter the names in 2 ways,
1) all on one line and let the textbox wrap them
-- name1,name2,name3,name4,name5,
name6 and so on
2) or like this
name1
name2
name3
and so on
if they enter like #2 I need to take each name one by one and get their
information.
> If you remove the new line characters. you're not going to get:
>
[quoted text clipped - 15 lines]
> name1
> name2?
Fred Chateau - 03 Aug 2007 18:40 GMT
Either way, I would use the Regex.Split() method in
System.Text.RegularExpressions.

Signature
Regards,
Fred Chateau
fchateauAtComcastDotNet
> well,
> the thing is I need to pass each name into a method so I can get their
[quoted text clipped - 36 lines]
>> name1
>> name2?
Steve - 03 Aug 2007 18:46 GMT
OK, I'll have to take a look at that due to I never used it.
do you have an example?
> Either way, I would use the Regex.Split() method in
> System.Text.RegularExpressions.
[quoted text clipped - 39 lines]
>>> name1
>>> name2?
Alexey Smirnov - 03 Aug 2007 23:46 GMT
> OK, I'll have to take a look at that due to I never used it.
>
> do you have an example?
string input = "name1\r\nname2";
foreach(string s in Regex.Split(input,"\r\n"))
{
other_method(s);
}
More about Regex.Split
http://msdn2.microsoft.com/en-us/library/system.text.regularexpressions.regex.sp
lit.aspx
Hope this helps
Jesse Houwing - 03 Aug 2007 18:45 GMT
Hello Steve,
You can use the split function of Strign to do this.
string[] names = inputString.Split(new char[]{',','\r','\n'}, StringSplitOptions.RemoveEmptyEntries)
Jesse
> well,
> the thing is I need to pass each name into a method so I can get their
[quoted text clipped - 36 lines]
>> name1
>> name2