2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Teme64
0

It could be done simply with VB.NET's Split method

Dim OneLine As String = "fristname.lastname@emailadress.com,,,,,,membergroup"
Dim SplittedLine() As String

' Split the whole string
SplittedLine = Strings.Split(OneLine, ",")
' Email address is now SplittedLine(0) and so on...

' Get first and last name
Dim Temp() As String

' First remove domain part
Temp = Strings.Split(SplittedLine(0), "@")

Dim Name() As String

' Finally, separate first and last name
Name = Strings.Split(Temp(0), ".")
' First name is in Name(0) and the last name is in Name(1)

Add proprietary error handling and "sanity" checks. The code blows if it encounters differently formatted data than expected ;)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.