Finding Substrings

  • Searches for a substring and returns its position within a overlaying string
  • .find() in Python
  • .indexOf() in JS
print("Hello Brawler".find("Brawler"))
6
%%js
console.log("Hello Brawler".indexOf("Brawler"));
<IPython.core.display.Javascript object>
  • Use Case: Helpful for parsing text or finding key words