對Mysql多行字串的處理7 10

2021-04-08 15:11:33 字數 592 閱讀 9777

做了乙個頁面,其中user會要在textbox3中輸入多行 ,在寫入資料庫前需要作如下處理

cone=textbox3.text '取得輸入的多行字串

cone = cone.replace("/", "//")'將/轉義為//

cone = cone.replace("'", "/'")'將'轉義為/'

cone = cone.replace("_", "/_")'將_轉義為/_

cone = cone.replace("%", "/%")'將%轉義為/%

cone = cone.replace("""", "/""")'將"轉義為/"

在讀取後要用js對上述資料進行處理前,需要如下動作:

dim ta as string = e.item.cells(10).text '取得多行的字串

ta = ta.replace(chr(13) & chr(10), "/r/n") '將回車換行符轉義為/r/n

js = "document.getelementbyid('bconent').innertext='" & ta & "';"

hyb2.attributes.add("onclick", js)

mysql拆分字串為多行

sql示例 select substring index substring index 張三,李四,王五,趙六,楊七 help topic id 1 1 as id from mysql.help topic where help topic id length 張三,李四,王五,趙六,楊七 le...

多行字串 模板字串

多行字串 下面是普通字串的寫法 普通字串 var l abcd console.log l 編譯結果 如何讓讓乙個字串獨佔多行呢?就需要用到es6 裡的多行字串 多行字串 var i ab cd console.log i 編譯結果 再說說拼接字串,一般情況我們是如何拼接字串的呢?看下面 正常拼接字...

mysql字串處理

1.時間轉字串 date format 日期,格式字串 select date format now y m d h i s 2.字串轉時間 str to date 字串,日誌格式 select str to date 2019 01 20 16 01 45 y m d h i s 3.時間轉時間戳...