You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result was an array of length one with a value of an empty string at index 0. But if the separator is empty the result becomes an array of length 0. But the separator shouldn't have made a difference on the result since the string I am trying to split is empty in the first place.
here is the link to my program. playground link
What did you expect to see?
The output should have been 0 since the strings I wanted to split is empty in the first place.
What did you see instead?
It resulted in an array of length 1. which has an empty string at index 0.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go playground
What did you do?
I tried to split an empty string with a non-empty separator using
strings.Split
method.The result was an array of length one with a value of an empty string at index 0. But if the separator is empty the result becomes an array of length 0. But the separator shouldn't have made a difference on the result since the string I am trying to split is empty in the first place.
here is the link to my program.
playground link
What did you expect to see?
The output should have been 0 since the strings I wanted to split is empty in the first place.
What did you see instead?
It resulted in an array of length 1. which has an empty string at index 0.
The text was updated successfully, but these errors were encountered: