[GIS] Using QGIS Field Calculator to replace backslash

field-calculatorqgis

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'.

Best Answer

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', '')