Skip to content

Commit

Permalink
Update task.md
Browse files Browse the repository at this point in the history
language checked
  • Loading branch information
stephen-hero authored Dec 20, 2023
1 parent ffeb0eb commit e231a94
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions AlmostDone/safeReadLineFunction/task.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
In previous assignments, we sometimes used the pre-defined `safeReadLine` function instead of built-in `readlnOrNull`.
In previous assignments, we sometimes used the predefined `safeReadLine` function instead of the built-in `readlnOrNull`.
The main reason is that `readlnOrNull` returns a _nullable_ value (`String?`).
The pre-defined `safeReadLine` function processed the input received from the user with the Elvis operator:
it returns the string or throws an error if the `null` value was received.
It's time to implement this function by yourself!
The pre-defined `safeReadLine` function processed the user's input with the Elvis operator:
it returns the string or throws an error if a `null` value was received.
Now, it's time to implement this function on your own!

### Task

Implement the `safeReadLine` function, which returns the string the user inputs or throws an error
if the `null` value was received.
Implement the `safeReadLine` function, which returns the string input by the user or throws an error
if a `null` value was received.

<div class="hint" title="Click me to see the signature of the safeReadLine function">

Expand Down

0 comments on commit e231a94

Please sign in to comment.