I actually use the Field Calculator "replace" formula that works very well but I have some '\' caracters in my field that I cannot replace. ex : '\naninana' and I want to keep only 'naninana'.

  • 1
    shouldn't "\n" be a line break?
    – Elio Diaz
    Nov 27, 2017 at 19:42

1 Answer 1


If you want to remove a \ in a field, you can escape it as in:

replace(fieldname, '\\', '')

Or if you wanted to remove \n:

replace(fieldname, '\\n', '')
  • It works with replace(fieldname, '\\', '') ! Thanks a lot @larsks
    – Cartophyl
    Nov 27, 2017 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.