Fall 2024 - P1
Big Idea 3 | .1 | .2 | .3 | .4 | .5 | .6 | .7 | .8 | .10 |
3.4 String Operations
3.4 Team Teach String Operations
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