Description
This statement updates a CFMutableStringVar, PascalStringVar or container$$, deleting a subpart from CFMutableStringVar, PascalStringVar or container$$ and replacing it with an equal number of characters from the left side of replaceCFString or replacePascalString. The subpart to be replaced begins at position startPos within CFMutableStringVar, PascalStringVar or container$$. In the following code fragments, containers and strings work the same.
The number of characters replaced equals the smallest of these quantities:
numChars
the length of replaceCFString/replacePascalString
the length of CFMutableStringVar/PascalStringVar - startPos + 1
Under the following circumstances, mid/mid$,mid$$ does nothing:
When CFMutableStringVar/PascalStringVar or replaceCFString/replacePascalString is empty;
When startPos is less than 0 or greater than the length of CFMutableStringVar;
When startPos is less than 1 or greater than the length of PascalStringVar;
When numChars is less than 1.
Notes
• CFMutableStrings are zero-based, which means the first character of the string is at position 0.
• The first character of a pascal string or container is at position 1.
• You may not use complex expressions that include containers on the right side of the equal sign.