MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / addStr

Function addStr

public/iframe/lib/js/commonFun.js:700–705  ·  view source on GitHub ↗
(oldStr, addItem, afterWhich)

Source from the content-addressed store, hash-verified

698 }
699 },
700 addStr(oldStr, addItem, afterWhich) {
701 // 在指定字符串后面添加指定字符串
702 const strArr = oldStr.split('');
703 strArr.splice(oldStr.indexOf(afterWhich) + afterWhich.length, 0, addItem);
704 return strArr.join('');
705 },
706 replaceStr(str, replaceStr, newStr) {
707 return str.replace(replaceStr, newStr)
708 },

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected