+ 1
What are all the syntax to split the string line by line
string
3 Respostas
+ 1
it is a easy way:
_________
string myString = "hello";
for(int i = 0; i < myString.Lenght; i++)
Console.WriteLine(myString[i]);
___________
output:
h
e
l
l
o
+ 1
How do you do this on python?
0
In your case:
string[] tokens = initial_string.Split('\n');
To split on all " and "s:
string[] tokens = initial_string.Split(new[] { " and " }, StringSplitOptions.None);