$FUNCNAME$
  STUFF()
$CATEGORY$
  STRING
$SUMMARY$
   Delete and insert characters in a string
$LANG_RU$
        .
$SYNTAX$
     STUFF(<cString>, <nStart>,	<nDelete>, <cInsert>) --> cNewString
$LANG_RU$
     STUFF(< >, < >, <-  >, < >)
     -->   
$ARGUMENTS$
     <cString> is the target character string into which characters are
     inserted and deleted.
     <nStart> is the starting position in the target string where the
     insertion/deletion occurs.
     <nDelete> is the number of characters to be deleted.
     <cInsert> is the string to be inserted.
$LANG_RU$
     < > -  ,     
       .
     < > -    ,   
      ().
     <-  > -  ,  .
     < > -  .
$RETURNS$
     STUFF() returns a copy of <cString> with the specified characters
     deleted and with <cInsert> inserted.
$LANG_RU$
     STUFF()    < >  
        ,    
     < >.
$DESCRIPTION$
     STUFF() is a character function that deletes <nDelete> characters from
     <cString> beginning at the <nStart> position.  Then, it inserts
     <cInsert> into the resulting string beginning at <nStart> to form the
     return string.  With this, STUFF() can perform the following six
     operations:

       Insert: If <nDelete> is zero, no characters are removed from
	<cString>.  <cInsert> is then inserted at <nStart>, and the entire
	string is returned.  For example, STUFF("My dog has fleas.", 12, 0,
	"no" ) returns "My dog has no fleas."

       Replace: If <cInsert> is the same length as <nDelete>,
	<cInsert> replaces characters beginning at <nStart>.  The same number
	of characters are deleted as are inserted, and the resulting string
	is the same length as the original.  For example, STUFF("My dog has
	fleas.", 12, 5, "bones") returns "My dog has bones."

       Delete: If <cInsert> is a null string (""), the number of
	characters specified by <nDelete> are removed from <cString>, and the
	string is returned without any added characters.  For example,
	STUFF("My dog has fleas.", 1, 3, "") returns "dog has fleas."

       Replace and insert: If <cInsert> is longer than <nDelete>, all
	characters from <nStart> up to <nDelete> are replaced and the rest of
	<cInsert> is inserted.  Since more characters are inserted than are
	deleted, the resulting string is always longer than the original.
	For example, STUFF("My dog has fleas.", 8, 3, "does not have")
	returns "My dog does not have fleas."

       Replace and delete: If the length of <cInsert> is less than
	<nDelete>, more characters are deleted than inserted.  The resulting
	string, therefore, is shorter than the original.  For example,
	STUFF("My dog has fleas.", 8, 3, "is") returns "My dog is fleas."

       Replace and delete rest: If <nDelete> is greater than or equal
	to the number of characters remaining in <cString> beginning with
	<nStart>, all remaining characters are deleted before <cInsert> is
	inserted.  For example, STUFF("My dog has fleas.", 8, 10, "is.")
	returns "My dog is."
$LANG_RU$
     STUFF()     , 
     ,      <- 
     >,   < >,   ,
       < >.    
      < >   ,  
     ,      < >, 
       .   STUFF()   
      :

      .    <-  > 
       ,   < >   . 
        < > ,   ,
         < >,   
       . :

       STUFF("My dog has fleas" , 12, 0, "no")

       : "My dog has no fleas".

      .    < >   
       ,     <-  >, 
        < >  ,   ,
         < >.    
       ,   ,      
       ,   . :

       STUFF("My dog has fleas", 12, 5, "bones")

       : "My dog has bones".

      .    < > 
           (""),  ,  
       < >,   ,  
       <-  >,     -
        .  :

       STUFF("My dog has fleas", 1, 3, "")

       : "dog has fleas".

        .    < >
       ,    <-  >, 
       ,   ,   <
       >,      <- 
       >, ,     <
       >   .   
       ,  ,    
       . :

       STUFF("My dog has fleas", 8, 3, "does not have")

       : "My dog does not have fleas".

        .    < >
       ,    <-  >,
         ,    . 
            .  :

       STUFF ("My dog has fleas", 8, 3, "is")

       : "My dog is fleas".

          .   
       <-  >     
       ,    ,  < >,
        < >,     
           < >.
       :

       STUFF("My dog has fleas", 8, 10, "is")

        "My dog is".


$EXAMPLES$

       These examples demonstrate the six basic operations of
	STUFF():

	// Insert
	? STUFF("ABCDEF", 2, 0, "xyz")      // Result: AxyzBCDEF
	// Replace
	? STUFF("ABCDEF", 2, 3, "xyz")      // Result: AxyzEF
	// Delete
	? STUFF("ABCDEF", 2, 2, "")         // Result: ADEF
	// Replace and insert
	? STUFF("ABCDEF", 2, 1, "xyz")      // Result: AxyzCDEF
	// Replace and delete
	? STUFF("ABCDEF", 2, 4, "xyz")      // Result: AxyzF
	// Replace and delete rest
	? STUFF("ABCDEF", 2, 10, "xyz")     // Result: Axyz


$LANG_RU$

            STUFF():

       // 
       ? STUFF("ABCDEF", 2, 0, "xyz")     // : AxyzBCDEF
       //
       // 
       ? STUFF("ABCDEF", 2, 3, "xyz")     // : AxyzEF
       //
       // 
       ? STUFF("ABCDEF", 2, 2, "")        // : ADEF
       //
       //   
       ? STUFF("ABCDEF", 2, 1, "xyz")     // : AxyzCDEF
       //
       //   
       ? STUFF("ABCDEF", 2, 4, "xyz")     // : AxyzF
       //
       //     
       ? STUFF("ABCDEF", 2, 10, "xyz")    // : Axyz


$SEEALSO$
  RAT(),RIGHT(),STRTRAN(),SUBSTR(),AT(),LEFT()
$END$
