0

Difference between split and split('\n') ?

while reading line in file I want to know what does split and split('\n') do

10th Nov 2017, 3:47 PM
Tarun S
Tarun S - avatar
1 Resposta
+ 11
.split does exactly what the name says, splits the string by its argument as separator. If you specify '\n' as argument, it will split the whole text (presumably from a loaded file) into end-of-line-separated list of strings.
10th Nov 2017, 4:17 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar