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
Splitting Strings
- Splits a string into a list of substrings based on a delimiter (most commonly a space or comma)
- .split() in Python and JS
print("Darryl,Mico,Fang".split(","))
['Darryl', 'Mico', 'Fang']
%%js
console.log("Darryl,Mico,Fang".split(","));
<IPython.core.display.Javascript object>
- Use Case: Parse through CSV files or processing large lists of items