Solved

remove everything after @ in string

Posted on 2011-02-17
3
1,202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Format Transaction Number 19 42
Error in Visual Project 10 43
What is needed to become a DBA? 7 46
EMAIL RANGES BASED ON CURRENT TIME 12 29
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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