Link Search Menu Expand Document

mid

Explanation Extracts a character string of the specified length from the specified position of the character string. The position is counted with 0 at the beginning of the string.
Call format var i = mid ( string, target location, length [, processing unit ])
Return value Extracted character string
Arguments String string Original character string
Integer position Position to start ejecting
Integer length Number of characters to extract
Integer processing unit 0: Treat as one character without distinguishing between half-width and full-width
1: Half-width characters are treated as one character, and full-width characters are treated as two characters. If omitted, half-width and full-width characters will not be distinguished.
*AI does not distinguish between half-width and full-width characters regardless of the argument*
Exception None
Example of use
var str = "I have a book. I have a pen.";
var s = mid(str, 9, 4);
print(s, "\n");
Related item left, right method