From 8c7f0ec6f2fd22df5c1b273906af6a1c86fd6036 Mon Sep 17 00:00:00 2001 From: r0man-ist <96392831+r0man-ist@users.noreply.github.com> Date: Wed, 12 Jun 2024 16:08:00 +0100 Subject: [PATCH] added sort function and clarified text The text says that subject heading appear in alphabetical order, but no sort function had been used. --- episodes/11-using-arrays-transformations.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/episodes/11-using-arrays-transformations.md b/episodes/11-using-arrays-transformations.md index 2c9c3699..880af2a2 100644 --- a/episodes/11-using-arrays-transformations.md +++ b/episodes/11-using-arrays-transformations.md @@ -92,13 +92,13 @@ value.split("|")[0] would result in the string: "crystal structure" -You can also join arrays together to make a 'String'. The GREL expression would look like +You can also sort and join arrays together to make a 'String'. The GREL expression would look like ``` -value.split("|").uniques().join("|") +value.split("|").uniques().sort().join("|") ``` -Taking the same example again, this would result in a string with the subjects in alphabetical order, listed with pipes between each subject. +Taking the same example again, this would result in a string with the subjects in alphabetical order (note that the sort function is case-sensitive), listed with pipes between each subject. ::::::::::::::::::::::::::::::::::::::: instructor