Skip to content

Commit

Permalink
added sort function and clarified text
Browse files Browse the repository at this point in the history
The text says that subject heading appear in alphabetical order, but no sort function had been used.
  • Loading branch information
r0man-ist authored Jun 12, 2024
1 parent 5ef0bb3 commit 8c7f0ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions episodes/11-using-arrays-transformations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8c7f0ec

Please sign in to comment.