假设我得到了
const s = "Old Man's War"
//Each indices represent the beginning and end index of the string
const indices = [
[ 0, 0 ],
[ 5, 5],
[ 11, 11]
]
索引代表我想要强调的内容的开始和结束。所以我想返回类似的东西
<span class="bold">O</span>ld M
<span class="bold">a</span>n's W
<span class="bold">a</span>r
我怎样才能做到这一点?似乎无法提出一个像样的算法。
墨色风雨
呼唤远方
凤凰求蛊
随时随地看视频慕课网APP
相关分类