I want to remove the substring of my string , it looks something like this :
At(Robot,Room3)
or
SwitchOn(Room2)
or
SwitchOff(Room1)
How can I remove all the characters from the left bracket ( to the right bracket ) , when I don’t know their indexes ?
If you know the string matches the pattern then you can do:
or if you want to be safer
You can also use the standard library
<regex>.