Solved

remove everything after @ in string

Posted on 2011-02-17
3
1,195 Views
Last Modified: 2012-06-27
Hi,

I want to remove everything from an email string after @ symbol.
vb.net please.

Thanks
0
Comment
Question by:al4ddin
3 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
Comment Utility
  Dim str As String
        str = "abc@mail.com"
        Dim newstr As String
        newstr = str.Substring(1, str.IndexOf("@")-1)

in newstr you will get result
0
 
LVL 17

Accepted Solution

by:
nepaluz earned 500 total points
Comment Utility
Dim xStr as String = "myemail@domain.com"
Dim yStr As String = xStr.Split("@").First
0
 
LVL 11

Expert Comment

by:Deepak Lakkad
Comment Utility
Hi

here is the modified code posted by Pratima_MCS

Dim str As String
        str = "abc@mail.com"
        Dim newstr As String
        newstr = str.Substring(0, str.IndexOf("@"))

Open in new window


- Deepak Lakkad
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now