Hello and welcome to the gold and programming language course in the previous session, we talked about
a split after mystery, and in this session we want to talk about the others eastern concept.
Spirit after in.
This function, ESPN+ stream into our service streams after each instance of the given separator and
returns a slice which contains these services.
Now you can see the scene techs.
Here, SDR is the string sit is the separator and and is used to find the number of solid strings to
return if angry turned down zero.
Then it returns atoms in solid strings and the last string service strings will not be.
If an equal to zero, then it will return Neal.
And if in less than zero, then it will return on solid strings.
Now let's go to the school with Cary Grant to illustrate how to split after in a string.
First, creating and initializing the three Issing variables of us, Esperon calling equals CET value.
Welcome.
Come on the Karma Go programming
language, go to next line.
Define another variable like SDR to column equals.
My name is rather.
And defined territory you are tree pollen equals set value for the example I am to go poor grammar now
dispelling a string variable before using a split after end function.
AFP STR Home is still a long and free PCR tool.
Just, you know, two and display 30.
It is still a tree is still empty.
Now is fleeting.
The given string using is split after and function.
For the example, it splits first string into all substring separated by the comma separator and returns
a slice which contains solid string.
Go to the next line.
Define a variable like resolved.
One calling equals the strings package that is split after end function.
First set variable like is still warm and set comma separate war and for third argument, assign count
value that determines the number of solid things to return.
For the example, we set three and define another variable life result.
Two column equals strings that string at the end, said variable estimate tool and set a space as separator
and sit for number of solid string and go to the next line and define another variable.
Like these are three Cullin equals package strings that select a split after end function.
Set variable is still tree and set exclamation mark as separator and set one as number of solid string
now displaying the result.
But it is for the example for the result one be display value on type of variable.
So right, if that is less and resolved, one type column per cent T upper case by case less T result
one column first and the back is less in search result one comma resolved one.
Now iterate result one.
String a slice and display value of it by the range for a loop.
Go to the next line and define it for loop.
For the score come out.
Already, the lowest value column equals range in result vanderslice a strange go through the body statement
and p the value
go out of the for loop range and display the other variables.
FP but I just and result to call insert value the result two and result three column and display resolve
three.
Reformat the court, save the project and execute the program.
Now we can see the output for the first variable defined the Como character as a separator and city
value as number of substring to use the split function and drop a slice of the string as a return value
inside the resultant body, even then display the value and the type of the result variable and use
the range for loop to iterate.
The result is nice value and the result one value even consists of three parts.
The answer to this for the second and third levels in third variable.
It does not contain the given separately.
Then it will return a slice of length, one which contain only its variable value in order not to prolong
the time of decision to be finished, and we will continue to contend in the next session.
Goodbye.