How can you recognize a carriage return? simple question

B

Burak

Hello,

I am trying to parse the following bounced email to
get the email adress

"Your message

To: (e-mail address removed)

Sent: Thu, 30 Oct 2003 11:05:05 -0500

did not reach the following recipient(s):
etc..."

I am having a hard time getting the correct domain
name because it seems there is a new line character
after "m" in .com. When I do a watch on it, it prints
out as a rectangle. I have tried everything I can
think of to have the program recognize that new line
or whatever it is but have had no luck.

Here is my code

indexStart = strToParse.IndexOf("@")

If indexStart > 0 Then

i = indexStart + 1
x = strToParse.Chars(i)

While x <> " " and x <> "" And x <> "<" And x <> ">" And x <> "null"
And x <> ":" And x <> "\f" And x <> "\n" And x <> "\r"
And x <> "vbcrlf" _
And x <> "np" And x <> "nl" And x <> "cr" And x <> "<br>"
And x <> "Char(10)" And x <> "Char(13)"

domain += x
i += 1
x = strToParse.Chars(i)
End While
End If

etc...

How can I catch that character and not include it in the domain name?

Thank you,

Burak
 
W

William Ryan

I'm pretty sure you can test for myChar = ControlChars.CrLf or .Cr .

HTH,

Bill
 
R

ru

Hello,

I clear CRLF from strings like so:
str.Replace(Chr(10), " ")

HTH,

ru
-----Original Message-----
Hello,

I am trying to parse the following bounced email to
get the email adress

"Your message

To: (e-mail address removed)

Sent: Thu, 30 Oct 2003 11:05:05 -0500

did not reach the following recipient(s):
etc..."

I am having a hard time getting the correct domain
name because it seems there is a new line character
after "m" in .com. When I do a watch on it, it prints
out as a rectangle. I have tried everything I can
think of to have the program recognize that new line
or whatever it is but have had no luck.

Here is my code

indexStart = strToParse.IndexOf("@")

If indexStart > 0 Then

i = indexStart + 1
x = strToParse.Chars(i)

While x <> " " and x <> "" And x <> "<" And x <> ">" And
x said:
And x <> ":" And x <> "\f" And x <> "\n" And x
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top