I need to split a string with a delimiter into a list of substrings in Python. Here's an example of the string I'm working with:
data = "apple;banana;cherry;orange" I want to convert this string into the following list:
['apple', 'banana', 'cherry', 'orange'] What's the most efficient and concise way to achieve this?
Thanks in advance!
source https://stackoverflow.com/questions/76076366/how-to-efficiently-split-a-string-with-a-delimiter-into-a-list-of-substrings-in
Comments
Post a Comment