New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String.startsWith returns True for an empty substring #717

Closed
Shemeikka opened this Issue Sep 21, 2016 · 3 comments

Comments

Projects
None yet
4 participants
@Shemeikka

Shemeikka commented Sep 21, 2016

Hi,

I noticed that String.startsWith returns True for an empty substring

> String.startsWith "" "Hello"
True : Bool

Shouldn't this be False?

Chrome 53
Windows 10
Elm 0.17.1

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Sep 21, 2016

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Sep 21, 2016

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@simonewebdesign

This comment has been minimized.

Show comment
Hide comment
@simonewebdesign

simonewebdesign Sep 21, 2016

I think it's correct, ES2015 has the same behavior:

"Hello".startsWith("")
=> true

simonewebdesign commented Sep 21, 2016

I think it's correct, ES2015 has the same behavior:

"Hello".startsWith("")
=> true
@Shemeikka

This comment has been minimized.

Show comment
Hide comment
@Shemeikka

Shemeikka Sep 21, 2016

Yeah,

So it seems. In fact, this seems to be same in every language.

I have to say that this goes against my logic even after reading the reasons for this behavior.

I think this issue can now be closed..

Shemeikka commented Sep 21, 2016

Yeah,

So it seems. In fact, this seems to be same in every language.

I have to say that this goes against my logic even after reading the reasons for this behavior.

I think this issue can now be closed..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment