How to Split Strings in Python With the split() Method

preview_player
Показать описание
You'll learn how to split strings in Python using the .split() method.

.split() has optional parameters that allow you to fine tune how strings are split. You’ll see how to use a bare call to .split() to cut out whitespace from a string and get a list of words.

You’ll also learn how to specify separators and also limit the number of splits in calls to split() using the "maxsplit" parameter.

Рекомендации по теме
Комментарии
Автор

Maxsplit was the real eye-opener for me

ashwithullal
Автор

Thanks for this video, I had been very confused in .split() method. Because of this video i have totally understood .split() method

granthsharma
Автор

Thank you Team Real Python. The best explanation ever seen.

keshavdk
Автор

your teaching style is very good. you give multiple examples to make us understand!. Thanks!

abubakarmeraj
Автор

Спасибо! Просто, понятно и доступно. Такое не часто встретишь.

milaleelavati
Автор

I was trying to use regex to do this exact thing but this was much simpler, tyvm!

PrimeEpoch
Автор

Thanks best explanation just what I was searching for

abdulwaris
Автор

This was precisely what I needed. Thank you!

justicehansen
Автор

I wrote some code for an assignment that worked, but I didn't really know why it worked lol. This helped a lot!

Qpwer
Автор

Thanks I have been looking for this video for a long time thanks thanks Please Keep it up

alaahoussen
Автор

is there a way to split on a certain delimiter but maintaining that delimiter in the list? and just making a list right before it?

chuchojuarez
Автор

can u tell how to divide a 32 bit binary string into 8 bit of chunks ?

mrkunalgoswami
Автор

is it possible to split it without loosing the s?

navinkamiabi
Автор

Thanks for that video I thought I know how to use split() hence I've never checked the official docs <facepalm>, now I know now about the "maxsplit" parameter, it would so useful :)

szymonf
Автор

Do you have a link to the concatenating and joining strings videos? I can't seem to find them. This is all good and interesting. Very useful information

softwhere
Автор

what if you have a comma-delimited string of number:s and words and you want to separate them:

input: "show, number, 10, 25, joe 9"

output: show, number, joe
10, 25, 9

manqobamkhwanazi
Автор

How to split a text file based on a separator and also on size

swathireddy
Автор

Sounding a bit more audible would make this video the best version of split method in the universe. Well done

swadhikarc
Автор

How about there is more then one symbol?

pakapeta
Автор

How would you split using more than 1 item in the string? For instance, would it be string.split("+", " -, " "*", "/") ??

doubledgaming