Command Reference : Function Reference : Function Reference: W
  
 
@winsert
Insert string into a string.
Syntax: @winsert(str1, str2, n)
str1: string
str2: string
n: integer
Return: string
Inserts the string str2 into the string str1 after the word position given by the integer n.
Examples
string sval1 = "I believe it can be done"
string sval2 = "not"
= @winsert("I believe it can be done", "not", 4)
= @insert(sval1, sval2, 4)
= @insert(sval1, "not”, 4)
all return the string “I believe it can not be done”.
If ALPHA1 is an alpha series,
alpha a1 = @winsert(sval2, "not", 4)
creates an alpha series with the contents of ALPHA1 with the string “not ” after word45, for each observation in the workfile sample.
alpha a2 = @winsert(sval1, a1, ser1)
inserts SVAL1 into A1 after the integer word positions given in the series SER1.
If SVEC1 is an svector,
svector s1 = @winsert("(pretty please) ", svec1, 5)
inserts “(pretty please) ” into SVEC at after word 4.
Cross-references
See also @wreplace, @insert, @instr, @rinstr, and @mid.