Stata 11 help for subinstr()

help subinstr() -------------------------------------------------------------------------------

Title

[D] functions -- Functions

String function

subinstr(s1,s2,s3,n) Domain s1: strings (to be substituted into) Domain s2: strings (to be substituted from) Domain s3: strings (to be substituted with) Domain n: integers 0 to 244 and missing Range: strings Description: returns s1, where the first n occurrences in s1 of s2 have been replaced with s3. If n is missing, all occurrences are replaced. Also see regexm(), regexr(), and regexs().

subinstr("this is this","is","X",1) = "thX is this" subinstr("this is this","is","X",2) = "thX X this" subinstr("this is this","is","X",.) = "thX X thX"

Also see

Manual: [D] functions

Help: [D] functions, [D] functions (string functions)


© Copyright 1996–2009 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index