str_escape() 對接收到的參數(shù)進行特殊字符轉(zhuǎn)義
str_escape() 接收一個參數(shù),為要需要轉(zhuǎn)義的字符串
以下是 str_escape() 的語法:
str_escape(value)
● vaule [str]:需要轉(zhuǎn)義的字符串。
返回一個字符串類型的數(shù)據(jù)
以下展示了使用 str_escape() 的實例:
from kyger.utility import str_escape word = str_escape(self.kg['get'].get('word', '')) # "'\0 print(word)
以上實例運行后輸出的結(jié)果為:
\\"\\'\\0