Hello and welcome to the Golang programming language course.
In the previous session, we talked about campaign extremes in goading and indecision.
We want to talk about the other's strengths concept.
John Estrin, by Delimiter or a separate or concatenating is strings, this strings package of gold
provides a join metal that can be used to join a string based upon a delimiter.
Now you can see the scene techs.
As you can notice, dysfunction takes a slice of string and a delimiter and return a combined issing
joined by a Delhi metro.
The Delhi metro or separately was placed between elements of the input, destroying a slice.
Please note it will return and interesting if the length of the input is nice is zero.
It will output a string component from the noise of strings if the input limit or secretary is A..
Now let's go to the school program to illustrate how to use concatenating strings and go like.
First, we create an initialized string variable by assigned joint function that contains separator.
So first, define a variable life result column equals strings package and select join function
and first set a slice of a string variable.
This life is strange and initialize it like a b and C D and E F and sit there as separate or comma,
then dash.
Now display the very eager if the
result
in chase to this list is empty.
Go to the next line resolved equals the strings dot join.
Sit a slice of history that is empty, her slice her string and set the ash separator.
And again, this really there isn't.
And in case separately, is A..
Go to the next line.
Resolved equals strength package don't in will join function.
Sit a slice of string
the string and initialize it for the accented G Edge.
I J and K L
and sit on four separate or go to the next line and display the variation of the result, reformat the
code, save the project and execute the program.
Now we can see the output, a b dash, c, d dash if and in second line non.
And in third non g is i k akl.
In first case, we said dash as delimiter and it will output a slice of length three and in second case,
a slice is empty.
And it will output a emptiest string.
And in the third case, separator is empty and it will output is string combine from this slice of strings.
Now we could see how to use concatenating esters in order not to prolong the time of decision.
We will finish sheet and we will continue the content in the next session.
Goodbye.