[Edit]
+
0
-
0
JavaScript - remove everything before certain character (including)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23const findText = (text, character) => { for (let i = 0; i < text.length; ++i) { if (text[i] === character) { return text.substring(i + 1); } } return text; }; // Usage example: const text = 'Removed part-example text...'; const character = '-'; const result = findText(text, character); console.log(result); // example text... // Output: // // example text...