我需要将以下代码行转换为 JavaScript:
cOrderNumList = frmSearch.OrderNumList.Value
cOrderNumList = Replace(cOrderNumList, Chr(10), "")
aOrderNumList = Split(cOrderNumList,",")
JavaScript中与Chr(10)
等效的是什么?
我需要将以下代码行转换为 JavaScript:
cOrderNumList = frmSearch.OrderNumList.Value
cOrderNumList = Replace(cOrderNumList, Chr(10), "")
aOrderNumList = Split(cOrderNumList,",")
JavaScript中与Chr(10)
等效的是什么?
cOrderNumList = frmSearch.OrderNumList.Value;
cOrderNumList = cOrderNumList.replace(String.fromCharCode(10), "");
aOrderNumList = cOrderNumList.split(",");
我的修改正确吗?
aOrderNumList = cOrderNumList.split(",");
。 - Madura HarshanaString.fromCharCode()
:cOrderNumList = Replace(cOrderNumList, String.fromCharCode(10), "")
要将字符代码转换为字符串,您可以采用以下方法:
var outputString = yourString.replace(cOrderNumList, String.fromCharCode(10))
请注意,这将把字符代码转换为一个字母字符串。你无法真正转换为纯字符,因为JavaScript中不存在char类型。
var outputString = yourString.replace(cOrderNumList, String.fromCharCode(10))
需要用空字符串 ""
替换吗? - Madura Harshana"\n"
。cOrderNumList = cOrderNumList.replace(/\n/g, "")