簡體   English   中英

匹配回車

[英]Matching a carriage return

回車符與正則表達式或硬編碼符號不匹配:

if (!senArray[i].indexOf(/\r/) || !senArray[i].indexOf('↵'))
    continue;

數組內容: senArray = ["↵"]

我該如何匹配它以便跳過當前迭代?

indexOf不接受正則表達式(如您提供的),而\\n可以正常工作。

 x=[` `] console.log(x.indexOf('\\n')) //.. 0 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM