sqlregexdatabrickshqlhtml-escape-characters

How to replace the escape unicode characters like \u001A in a string to empty spaces


I have a string like A, with unicode escape characters. How can I replace those characters with empty spaces in SQL?

A

My Name is \u001AVinaykumar. I am \u001AFrom AndhraPradesh. I have completed my B.tech\u001A in Osmania University

B

My Name is Vinaykumar. I am From AndhraPradesh. I have completed my B.tech in Osmania University

I have tried to use the regex function but it doesn't work.


Solution

  • You can try the REPLACE function to do this: REPLACE(string, old_string, new_string)

    Your function would look like this.

    SELECT REPLACE(A, '\u001A', '');