We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f04297 commit d390969Copy full SHA for d390969
1 file changed
p5.input.js
@@ -6,11 +6,7 @@ window.aKeyPressed = false;
6
String.prototype.replaceAll = function (stringToFind, stringToReplace) {
7
if (stringToFind === stringToReplace) return this;
8
var temp = this;
9
- var index = temp.indexOf(stringToFind);
10
- while (index != -1) {
11
- temp = temp.replace(stringToFind, stringToReplace);
12
- index = temp.indexOf(stringToFind);
13
- }
+ temp = (((stringToFind.length < 1) && temp.includes(stringToFind)) ? (temp.split(stringToFind).join(stringToReplace)) : (temp))
14
return temp;
15
};
16
0 commit comments