【发布时间】:2023-02-02 10:18:23
【问题描述】:
我需要一个函数来从字符串中删除一个字符串并返回原始字符串,其中使用索引开始删除并计算要删除的字符数。
function removeFromString(str, index, count) {
let char = (count + index);
(str.slice(index, char))
console.log (str);
}
``
Im expecting to get the original string returned with the characters indicated removed. I wrote this wrong previously.
【问题讨论】:
-
在任何情况下你都不会返回任何东西。
-
你有一些例子吗?
标签: javascript