Saturday, August 14, 2010

Visual Basic String Function : Split

purpose : Split examines an expression and parses out substrings based on a specified delimiter.The substrings that are parsed out are placed into a zero-based array.

Syntax :
Split ( expression [ , delimiter [ , count [ , compare ] ] ] )

expression : String value to be processed.
delimiter : String value identifying one substring from another. If this value is omitted, a blank space ( " " ) is used a s the delimiter.
count : Indicator how many time through the expression the function loops . if this value is omitted, the entire expression is processed.
compare : Indicator for the type of comparison between the delimiter and the expression.

0 : vbBinaryCompare
1 : vbTextCompare
2 : vbDatabasecompare

sName = Split ( "Mr. Jonathan Smythe")

the result of the Split function crates a one-dimensional array in sName, where
sName(0) = "Mr."
sName(1) = "Jonathan."
sName(2) = "Smythe."

No comments:

Post a Comment