var text = "Some text here"var myName = "toby"var hits = [] for (var i = 0; i < text.length; ++i) { if (text[i] === 't') { for (var j = 0; j < i + myName.length; ++j) { hits.push(text[i + j]) } }} print(hits)
Standard input is empty
t,e,x,t, ,h,e,r,e,t, ,h,e,r,e,,,,,,
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!