Does the MySQL TRIM function not trim line breaks or carriage returns?

后端 未结 10 1832
旧时难觅i
旧时难觅i 2020-12-03 13:58

From my experiments, it does not appear to do so. If this is indeed true, what is the best method for removing line breaks? I\'m currently experimenting with the parameters

10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-03 14:11

    Trim() in MySQL only removes spaces.

    I don't believe there is a built-in way to remove all kinds of trailing and leading whitespace in MySQL, unless you repeatedly use Trim().

    I suggest you use another language to clean up your current data and simply make sure your inputs are sanitized from now on.

提交回复
热议问题