Skip to content
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> split at <string> doesn't work; while split <string> at <string> works #719

Closed
ghost opened this issue Jul 11, 2017 · 5 comments
Closed
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@ghost
Copy link

ghost commented Jul 11, 2017

The syntax <string> split at <string> doesn't work when splitting an explicit string, such as
set {_test::*} to "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday" split at ","

However, using the alternative syntax split <string> at <string> such as
set {_test::*} to split "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday" at ","

or a string variable
set {_test::*} to {_weekdays} split at ","

works.

@Snow-Pyon
Copy link

I can confirm this, for some reason, the first pattern doesn't accept literals.

@TheBentoBox TheBentoBox added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jul 11, 2017
@TheBentoBox
Copy link
Member

That's interesting, I've never been able to split string literals because I always use the first syntax and I assumed it was just a limitation of the expression for whatever reason.

@bensku
Copy link
Member

bensku commented Jul 12, 2017

Hmm, this is weird... I hope it is just a typo and no spaghetti parser bug.

@Snow-Pyon Snow-Pyon added the priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). label Jan 31, 2018
@Pikachu920
Copy link
Member

more info on this: it happens any time a string literal is the start of a pattern. Even if you don't take in a literal string, for example, %objects% wont init and in my script I put "string" wont init, my expression will never have init called.

@Pikachu920
Copy link
Member

you can surround the string in () like ("Abc") to fix this, credit to @Blueyescat for finding the workaround. Maybe that will help you if you work on this issue @bensku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests

6 participants