Skip to content

Commit

Permalink
Merge pull request #348 from r0man-ist/r0man-ist-patch-1
Browse files Browse the repository at this point in the history
added sort function and clarified text
  • Loading branch information
ostephens authored Jun 13, 2024
2 parents 5ef0bb3 + 8c7f0ec commit 5d9573e
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 5d9573e

Please sign in to comment.