I have to do a lot of changing the brackets around some text for example this: [aString] -> (aString)
or vice versa
I have managed to do the basic task, but I am having trouble with some logic.
I want to use the same command to do both things. I use:
Code: Select all
SubGet(LongString, 1)
I want to then compare in an if statement like this:
Code: Select all
FirstChar := StrGet(Current_Clipboard, 1)
SquareBracket := [
RoundBracket := (
if (FirstChar = SquareBracket)
{
StringReplace, Current_Clipboard, Current_Clipboard, [, (
StringReplace, Current_Clipboard, Current_Clipboard, ], )
}
else if(FirstChar = RoundBracket )
{
StringReplace, Current_Clipboard, Current_Clipboard, (, ]
StringReplace, Current_Clipboard, Current_Clipboard, (, ]
}
Code: Select all
SquareBracket := [
I have tried many unsuccesful attempts to put %[% or '[' etc but I am grasping at straws.
How do I do this? Or how to I work the logic in a better way than this
Thanks