Home>Article>Topics> What is the function of mid?

What is the function of mid?

藏色散人
藏色散人 Original
2019-06-03 10:04:02 19629browse

What is the function of mid?

Mid is a string function in Visual Basic and Microsoft Excel. Its function is to intercept a specified number of characters from a string.

The three parameters of this function are equivalent to each other in VB and Excel, but the Length parameter in VB can be omitted, while the num_chars parameter in Excel cannot be omitted.

When the Start (start_num) parameter is less than 1, the function returns an error;

When the Start parameter value is greater than the String (text) parameter length, an empty string is returned;

If the length of the interception from the Start parameter exceeds the end of the string, or the Length parameter is omitted, all characters from the Start parameter position to the end of the string will be returned.

Grammar

##VB in

Mid(String As Variant, Start As Long, [Length As Variant]) As Variant Mid$(String As String, Start As Long, [Length As Variant]) As String

Excel

MID(text, start_num, num_chars)

What is the function of mid?

The above is the detailed content of What is the function of mid?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:None Next article:excel如何启用宏