Closed ptaillandier closed 1 year ago
Actually no. If you look at the doc, it rightly says : Returns a list containing the sub-strings (tokens) of the left-hand operand delimited by each of the characters of the right-hand operand
To use the whole string as a delimiter, you have to use the second form of split_with
with a boolean argument set to true. i.e:
write "333%444" split_with ("%%", true);
Very interesting. However, for me, the default behavior should be "333%444" split_with ("%%", true)
to be consistent with older versions of GAMA and because it seems to be a lot more natural for modelers who are not computer scientists :) .
Should I mention who implemented this operator like this in 2018 ?? 🤣
(https://github.com/gama-platform/gama/commit/c9d2a09186ebc2bb9b2fb74588bd54f4c4f4d48e)
2018 .... it is very recent considering the long history of GAMA 😅
Le jeu. 3 mars 2022 à 10:09, Alexis Drogoul @.***> a écrit :
Should I mention who implemented this operator like this in 2018 ?? 🤣
(c9d2a09 https://github.com/gama-platform/gama/commit/c9d2a09186ebc2bb9b2fb74588bd54f4c4f4d48e )
Maybe. But the important thing to consider is the who ^^
So I let you decide whether to close it or change your implementation 😀
Let's close this issue -- everything works as intended !
Describe the bug Test the following expression: write "333%444" split_with "%%";
It should returns a list composed of only one element ["333%444"]. Instead GAMA returns ['333','444']
Desktop (please complete the following information):