Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_StringCaseSensitiveString Functions

Public Function SplitMultiDelim (
s As String,
RemoveEmptyResults As Boolean,
PrependDelimToResults As Boolean,
ParamArray Delims() As Variant
) As String()

Split the string into a (zero based) array like the builtin Split() function, but use a list of delimiters and split on any one of them. Useful for parsing expressions.

s as String

The string to split

RemoveEmptyResults as Boolean

Don't add empty elements to the array (if the string is empty, the array will be memberless)

PrependDelimToResults as Boolean

Add the delimiter back to the front of the array element (so we can tell which delimiter was used)

ParamArray Delims() as Variant

The list of splitting delimiters

Call Template:

Dim s() As String
s = xf.StrCS.SplitMultiDelim(s, RemoveEmptyResults, PrependDelimToResults, Delims)

See Also:

Example 1:

Dim m_arr() As String
m_arr = xf.str.SplitMultiDelim("base + buttonwidth / 1cm", False, True, "+", "-", "*", "/")   => m_arr(0) = "base", m_arr(1) = "+ buttonwidth", m_arr(2) = "/ 1cm"
m_arr = xf.str.SplitMultiDelim("base + buttonwidth / 1cm", False, False, "+", "-", "*", "/")   => m_arr(0) = "base", m_arr(1) = "buttonwidth", m_arr(2) = "1cm"
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd