08-23-2022, 11:53 AM
adding ' or " marks around the string, I want to make it easier to operate
I thought of the following method, adding it based on the number of spaces at the end of the string
bug, How to apply to the replace operation of the text edit box above
I tried unsuccessfully
Macro Macro6
I thought of the following method, adding it based on the number of spaces at the end of the string
bug, How to apply to the replace operation of the text edit box above
I tried unsuccessfully
Macro Macro6
_s="abc" ;;no space after abc -> out abc
_s="abc " ;;There is a space after abc -> out 'abc'
_s="abc " ;;There are two spaces after abc -> out "abc"
str pattern2=".+ $"
str pattern1=".+ $"
if(findrx(_s pattern2)=0)
,out F"''{_s.trim}''" ;;out "abc"
else if(findrx(_s pattern1)=0)
,out F"'{_s.trim}'" ;;out 'abc'
else
,out _s ;;out abc