|Split a string|
|By: John A. Nyhart Date: 22/07/1997|
This function will split a string into two parts. A special char will be the division. For example: the string firstname.lastname@example.org 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
divchar: 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("email@example.com","@","F") to get mark
GetString("firstname.lastname@example.org","@","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.
|Visual Basic Programming Zone is a website by
Lorenzo Dalla Vecchia.
Webmaster's e-mail: email@example.com
Hosted by InWind: www.inwind.it