从数据库取数据时,带有回车换行符替换方法

    xiaoxiao2021-03-25  140

    Public Shared Function delEnterCharForPrint2(ByVal strValue As String) As String Dim strReturn As String = strValue '单引号(因为后面会加入单引号,所以必须先替换单引号) strReturn = strReturn.Replace(Chr(39).ToString, "'+ String.fromCharCode(39) +'") '替换回车符 strReturn = strReturn.Replace(Chr(10).ToString, "'+ String.fromCharCode(10) +'") strReturn = strReturn.Replace(Chr(13).ToString, "'+ String.fromCharCode(13) +'") strReturn = strReturn.Replace(Chr(92).ToString, "'+ String.fromCharCode(92) +'") Return strReturn End Function
    转载请注明原文地址: https://ju.6miu.com/read-5218.html

    最新回复(0)