Quote:
This is my strin looks like:
Hello
World
I tried like this:
arr = string.split()
print(arr)
it return this: ['World']
it not include the "hello"
.
Not true!
Take a look at below examples:
txt = "Hello,\nWord!"
x = txt.split()
print(x)
txt = "welcome to the jungle"
x = txt.split()
print(x)