-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Hints | ||
For simplicity and readability: Consider using the Scala collection functions instead of Java's `String` methods. Remember that in Scala is implicitly also a `Seq[Char]`, so you can call them as easily as the `String` methods. | ||
Some examples: | ||
- `filter` instead of `replaceAll` | ||
- `take`, `takeRight`, `drop`, `head`, `tail` instead of `substring` | ||
|
||
Another idea worth exploring might be to change the `String` into a `List[Char]` | ||
and then use [pattern matching](http://alvinalexander.com/scala/how-to-use-lists-nil-cons-scala-match-case-expressions) with the `::` operator. |