Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update task.md #217

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading