Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 30th, 2007, 01:32 AM
Authorized User
Join Date: Sep 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to find a string in another string in vb6

I have sql server coulmn which stores all mailaddress.I want to filter out only the part of the string after @ symbol i.e I want to filter all domain name.Suppose mail-d is john@gmail.com then it should give only @gmail.com.Plz help me urgently


Old March 30th, 2007, 03:11 AM
Authorized User
Join Date: Feb 2006
Posts: 67
Thanks: 7
Thanked 0 Times in 0 Posts
Send a message via Yahoo to beetle_jaipur

Hi Satish

u can use instr and mid function for extracting the part
first use instr function to get the location of @ symbol and then use
mid function for extract the string


ashok sharma

Old March 30th, 2007, 03:39 AM
Friend of Wrox
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts

Here you have sathish

Sub Get_EMail()

sEmail = "sathish@google.com"

arTemp = Split(sEmail, "@")

sDomain = arTemp(UBound(arTemp))
End Sub


Old March 30th, 2007, 12:17 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts


domain = Right$(myString, len(myString)- instr(1,myString,"@"))

"There are two ways to write error-free programs. Only the third one works."

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Matching pattern in Given String sanjivbshinde ASP.NET 2.0 Professional 3 October 10th, 2008 06:32 PM
Find String in query vishwadh SQL Server ASP 3 September 6th, 2006 03:16 AM
syntax to find a string in a string cole SQL Server 2000 2 October 10th, 2005 06:06 PM
String in VB6 ? huyremy Beginning VB 6 3 November 24th, 2004 04:30 PM
String Manipulation in VB6 Jay5817 Pro VB 6 7 January 20th, 2004 01:55 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.