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;


I really appreciate your help.

>Solution :

Please try

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

Leave a Reply