Solved

remove everything after @ in string

Posted on 2011-02-17
3
1,196 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
ID: 34914459
  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
ID: 34914529
Dim xStr as String = "myemail@domain.com"
Dim yStr As String = xStr.Split("@").First
0
 
LVL 11

Expert Comment

by:Deepak Lakkad
ID: 34914596
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I build my own IDE using ASP.NET MVC? 2 24
Name space syntax error 12 39
In WPF / C# binding a local database in code behind 1 24
Message not shown 5 27
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

932 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

14 Experts available now in Live!

Get 1:1 Help Now