C++
AcString mid( Adesk::Int32 nStart, Adesk::Int32 nNumChars ) const;
Description
Gets a substring from the string.
The functionality is the same as the substr() method.
Parameters
Parameters | Description |
---|---|
nStart | Input index (in characters) from the start of the string. |
nNumChars | Input number of characters to retrieve. If nNumChars is -1, then return the rest of the string. |
Returns
An AcString object consisting of the specified substring.
Remarks
Negative nStart is treated as 0.
Negative nNumChars is treated as -1 meaning the rest of the string is returned.
Links
Previous Declaration
AutoCAD 2024 and earlier
AcString mid(int nStart, int nNumChars) const;
inline AcString AcString::mid(int nStart, int nNumChars) const;
History
AutoCAD 2025
nStart and nNumChars arguments now expect an Adesk::Int32 instead of int.