I have the following strings
string <- c("Trade (% of GDP) – Latin America & Caribbean (WB/WDI/NE.TRD.GNFS.ZS-ZJ)", "Trade (% of GDP) – North America (WB/WDI/NE.TRD.GNFS.ZS-XU)" )
In this string, I want to remove everything except the ``middle" sentence.
My expected result should look like this:
excpected_string <- c("Latin America & Caribbean", "North America" )
Can someone help me how I can do this using gsub