fork download
  1. var text = "Some text here"
  2. var myName = "toby"
  3. var hits = []
  4.  
  5. for (var i = 0; i < text.length; ++i) {
  6. if (text[i] === 't') {
  7. for (var j = 0; j < i + myName.length; ++j) {
  8. hits.push(text[i + j])
  9. }
  10. }
  11. }
  12.  
  13. print(hits)
Success #stdin #stdout 0.01s 30320KB
stdin
Standard input is empty
stdout
t,e,x,t, ,h,e,r,e,t, ,h,e,r,e,,,,,,