[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: RE: Replace a substring
. search substring
points to help on functions. At some point every user
past neophyte should scan the list of functions that to
make a note of potentially useful things.
Frank de Libero
> The function, subinstr(), (or regular expression functions)
> will do it.
> E.g., gen newvar = subinstr(oldvar,"dis","reg",.).
> I am hoping that this is quick and simple to answer. I want
> to replace
> all occurrences of a substring in some string variable with another
> substring. E.g. I want to replace "dis" with "reg" so that the old
> variable has the values:
> and the new variable is
> Using Nick's egenmore, this can be done for whole words using -msub-,
> but how can this be done when the string to be replaced is
> not a whole word?
* For searches and help try: