SQLite allows you to put line breaks inside string literals, for example:
SELECT replace(dirty_text_field, ' ', '');
If you don't like this syntax, you can pass the string as BLOB : X'0D' for \r or X'0A' for \n (assuming the default encoding is UTF-8).
Edit:. Since this answer was originally written, SQLite added the CHAR function. So now you can write CHAR(13) for \r or CHAR(10) for \n , which will work regardless of whether your database is encoded in UTF-8 or UTF-16.
dan04
source share