Need to remove the {} from input field - input$fieldname

I have an input field which it will have value like this --> {ABCD}{U23}.

Need to remove {} before hitting my impala query should be like this --> ABCDU23. I tried using gsub(), str_replace(), rm_curly() but no luck. Anyone came across this fix can help me.


Try this:

stringr::str_replace_all("{ABCD}{U23}", "\\{|\\}", "")



input <- input %>%
  mutate(fieldname = fieldname %>% str_replace_all("\{|\}", ""))


This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

I tried the below one but failed to get the output.

stringr::str_replace_all(input$fieldname, "\{|\}", "")

The above code is not working.

Is it below one work?
gsub("[{}]", "", input$fieldname)