简体   繁体   中英

how to convert vbscript Mid function to javascript with 2 arguments?

    nHighlightedRow = Mid(string, 2, 11)  

I can convert this like ,

    var nHighlightedRow = string.subStr(2-1,11)

but I have to convert this,

    nHighlightedRow = Mid(string, 11)

can I convert this as follow ?

    var nHighlightedRow = string.subStr(0,11)

no.

it would be string.substring(11-1) .

不, Mid(string,11)从字符11提取到字符串的末尾, string.substring(0,11)从字符1提取,您将需要string.substring(10)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM