Split a string
By: John A. Nyhart Date: 22/07/1997



741 bytes

Download now!

This function will split a string into two parts. A special char will be the division. For example: the string mark@aol.com is the combination of mark and aol.com, divided by the @ char. This function will split the string and return either the front or the back part.


GetString(string, divchar, mode)


string: is the string being splitted
: is the character marking the division
mode: specify F for the first part, B for the second

Type of data



One of the two parts of the initial string.


For the above example we'll use:

GetString("mark@aol.com","@","F") to get mark
GetString("mark@aol.com","@","B") to get aol.com

As shown in the examples, this function will be useful with email addresses.

The function is contained in a module. You can cut and paste it in any program of yours.

Click Here!

Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
Webmaster's e-mail: webmaster@vbprogzone.cjb.net
Hosted by InWind: www.inwind.it