views:

298

answers:

3

This is probably quite a simple question, but I can't remember how to do it off hand.

I have an e-mail address of "[email protected]".

I want to grab the @ and everything after it and then I'll be adding a prefix to the front of the address as I go.

I'm just wonderng how I get hold of the @bar.com from the string?

I know I should know how to do this as this is a really simple operation.

Thanks in advance for any help.

A: 

String.Split() ?

Mark Redman
+3  A: 
"[email protected]".Split("@")(1)
Darin Dimitrov
+2  A: 

You can use simple string operations for this:

email.Substring(email.IndexOf("@"C))
Guffa