Syntax
Public Function MidString(stringVar As String, start As Long, Optional lengthVar As Integer) As String
Description
This function is used to return a string containing a specified number of characters from a string.
Parameters
Key | Description |
stringVar | String expression from which characters are returned. |
start | Starting position of characters to returned, value of type long |
lengthVar | Number of character to returned , Optional value of type Integer |
Return value
Returns string a value which containing the number of characters in the string we entered.
Exceptions
Error number | Condition |
5 | Start <= 0 or lengthVar <0 |
Sample
Public Sub main()Dim Str Dim Result str= "VertexFX"Result = MidString(str,2,3)AlertMessage(Result)' it will return ertEnd Sub
See Also