Function Stuff() Foundation
Inserts and/or deletes characters in a character string.
Stuff(<cString>, <nStart>, <nDelete>, <cInsert>) --> cNewString
Stuff() returns a copy of <cString> as a character string in which <nDelete> characters are deleted and the characters <cInsert>are inserted.
The character function Stuff() allows complex character string operations which perform insertions and deletions at the same time. <nDelete> characters are deleted from the initial character string <cString> beginning with the position <nStart>. Then, the character string <cInsert> is inserted, also at the position <nStart>. The resulting string is returned. The function Stuff() allows six different character string operations:
Insert: When the value for <nDelete> is zero, no characters are deleted from <cString>. <cInsert> is inserted at the position <nStart>.
Delete: When <cInsert> is a null string (""), the number of <nDelete> characters are deleted from <cString> at the position <nStart> and no characters are inserted.
Replace: When the value for <nDelete> is exactly the same as the length of <cInsert>, as many characters are deleted as are inserted. Exactly <nDelete> characters from the position <nStart> are replaced with <cInsert>.
Replace and insert: When the value for <nDelete> is less than the length of <cInsert>, fewer characters are deleted than inserted. The return value is a longer character string than the initial value.
Replace and delete: When the value for <nDelete> is greater than the length of <cInsert>, more characters are deleted than inserted. The return value is a shorter character string than the initial value.
Replace and delete rest: When the value for <nDelete> is equal to or greater than the remaining characters in <cString> starting at the position <nStart>, characters at the end of <nString>are deleted and <cInsert> is attached at the end.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.