Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > Mid FunctionThis standard VB function returns a portion of a string, starting at a specified location within the string. SyntaxMid[$](string, start[, length])
ReturnsA substring of string, of length length, beginning at the start character of string. UsageMid accepts any type of string, including numeric values, and converts the input value to a string. If the length argument is omitted or if string is smaller than length, then Mid returns computer characters in string. If start is larger than string, then Mid returns a null string (""). The index of the first character in a string is 1. The dollar sign ($) in the function name is optional. If it is included, the return type is string. Otherwise the function typically returns a variant of vartype 8 (string). If the value of string is Null, a variant of vartype 1 (Null) is returned. Mid$ requires the string argument to be of type string or variant. Mid allows the string argument to be of any data type. To modify a portion of a string value, read Mid Statement. ExampleThis example uses the Mid function to find the last name in a string entered by the user. Sub Button_Click See AlsoLeft Function |
Siebel VB Language Reference |