Remove all special characters from string except Turkish ones

there are tons of similar questions but i couldn’t find the exact answer.

I have a text like this;

str <- "NG*-#+ÜÇ12 NET GROUPنت ياترم "

I want to remove all special and non-Turkish characters and keep the others. Desired output is;

"NGÜÇ12 NET GROUP"

I really appreciate your help.

>Solution :

Please try

library(stringr)
str <- "NG*-#+ÜÇ12 NET GROUPنت ياترم "
str_replace_all(str, '[^[\\da-zA-Z ÜüİıÇ窺Ğğ]]', '')

Leave a Reply