Thank you for Visiting my Blog

Sunday, 15 October 2017

How Split Functon works


Split Function:
Description:

Returns a zero-based, one-dimensional array containing a specified number of substrings.

Syntax:

Split(expression[, delimiter[, limit[, compare]]])

Arguments:

PartDescription
expressionRequired. String expression containing substrings and delimiters. If expression is a zero-length string(""), Split returns an empty array, that is, an array with no elements and no data.
delimiterOptional. String character used to identify substring limits. If omitted, the space character (" ") is assumed to be the delimiter. If delimiter is a zero-length string, a single-element array containing the entire expression string is returned.
limitOptional. Number of substrings to be returned; –1 indicates that all substrings are returned.
compareOptional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values.
 
Example :


Sub SplitFn()

Dim Strname() As String

Strname = Split("HELLO WORLD")

MsgBox (Strname(0) & Chr(10) & Strname(1))

End Sub

No comments:

Post a Comment