我正在收集用户数据,但这些数据可能非常不可靠。因此,在将其保存到PostgreSQL数据库之前,我必须清除字符串开头和结尾的所有额外字符。
Is this Possible to achieve?
' \n \t \n \r\n abc_def_\n xyz \r\n ' to 'abc_def_\n xyz'
Are there any more whitespace like characters that I should care about?
\n newline \r carriage return \t horizontal tab whitespace
+
应该改为*
),假设输入是'this'
。 - Jasen