Command Reference : Function Reference : Function Reference: S
  
 
@stripparens
Remove paired leading and trailing parentheses surrounding string.
Syntax: @stripparens(str)
str: string
Return: string
Returns the contents of the string str with parentheses (“( )”) stripped from both the left and the right ends. If a parenthesis is present on only the left or right end, the parenthesis will be retained.
Examples
Let
string s1 = "(I don’t know)"
so that S1 contains the string “(I don’t know)”.
Then the commands
string sq1 = @stripparens("(I don’t know)")
string sq2 = @stripparens(s1)
create SQ1 and SQ2 which contain the string “I don’t know”.
If ALPHA1 is an alpha series, the command
alpha a1 = @stripquotes(alpha1)
fills A1 with parens-removed values of ALPHA1 for each observation in the workfile sample.
If AVEC1 is an svector, the commands
svector as1 = @stripparens(avec1)
svector as2 = @stripparens(avec1.@rows(@range(2, 6))
creates svectors AS1 and AS2, where AS1 contains parens-removed values of AVEC1, and AS2 contains parens-removed values of the rows 2 through 6 of AVEC1.
Cross-references
See also @stripcommas and @stripquotes.