Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_StringCaseSensitiveString Functions

Public Function SafeMid (
s As String,
StartChar As Long,
Optional Length As Long = 0
) As String

Same as the Mid() VBA builtin string function, but if there's an error just return the empty string.

s as String

The string to search

StartChar as Long

The start position of the substring

Optional Length as Long = 0

The number of characters to return, or -1 for the rest of the string

Call Template:

Dim s As String
s = xf.StrCS.SafeMid(s, StartChar)
s = xf.StrCS.SafeMid(s, StartChar, Length)

See Also:

Example 1:

xf.Str.SafeMid("The King's counting house", 12)      => counting house
xf.Str.SafeMid("The King's counting house", 12, 5)   => count
xf.Str.SafeMid("The King's counting house", 35, 5)   =>
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd