Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the JavaScript equivalent for the vbscript Chr() function?

I need to convert following lines to JavaScript:

cOrderNumList = frmSearch.OrderNumList.Value
cOrderNumList = Replace(cOrderNumList, Chr(10), "")
aOrderNumList = Split(cOrderNumList,",")

What is the JavaScript equivalent of Chr(10)

like image 320
Madura Harshana Avatar asked Dec 14 '12 08:12

Madura Harshana


2 Answers

cOrderNumList = frmSearch.OrderNumList.Value;
cOrderNumList = cOrderNumList.replace(String.fromCharCode(10), "");
aOrderNumList = cOrderNumList.split(",");

Are my changes correct?

like image 95
user160820 Avatar answered Sep 28 '22 01:09

user160820


You need String.fromCharCode():

cOrderNumList = Replace(cOrderNumList, String.fromCharCode(10), "")
like image 41
Sirko Avatar answered Sep 28 '22 02:09

Sirko