INS$ function

Purpose: This function will insert a substring in a string.


 Syntax:

 RetStr$ = INS$(MainStr$, Position%, SubStr$)

 Parameters:

  • RetStr$
  • MainStr$ String in which substring is to be inserted.
  • Position% Position at which insertion will begin.
  • SubStr$ String to be inserted.

Example:


 DIM myMainStr$
 DIM str1$

 str1$ = "ABCGHI"
 myMainStr$ = INS$(str1$, 4, "def")
 PRINT myMainStr$
 PRINT LEN(myMainStr$)