# Accepting input from the user

**URL:** <https://discuss.kotlinlang.org/t/accepting-input-from-the-user/2170>\
**Category:** Uncategorized\
**Created:** [December 22, 2016, 5:20pm UTC](https://discuss.kotlinlang.org/t/accepting-input-from-the-user/2170 "2016-12-22T17:20:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iivri](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@iivri](https://discuss.kotlinlang.org/u/iivri)\
**Post date:** [December 22, 2016, 5:20pm UTC](https://discuss.kotlinlang.org/t/accepting-input-from-the-user/2170/1 "2016-12-22T17:20:12Z")

</div>

In Kotlin this is the design for accepting input from the user, could someone , line by line, explain what this means ?

**_readLine()!!.split(’ ') .map(String::toInt)_**

---

<div class="post-metadata">

**Author:** ![ilya.gorbunov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/ilya.gorbunov/32/1645_2.png) [@ilya.gorbunov](https://discuss.kotlinlang.org/u/ilya.gorbunov)\
**Post date:** [December 23, 2016, 2:16pm UTC](https://discuss.kotlinlang.org/t/accepting-input-from-the-user/2170/2 "2016-12-23T14:16:54Z")

</div>

There are three function invocations here:

- first `readLine` function reads a line from the standard input;  
that function can return null in case if the end of the standard input is reached, but if you work with console, you’re sure that it’s not that, so you use `!!` to assert that the value is not null;
- then `split` function invoked on the result of `readLine` splits the line to a list of strings, using space character as a separator;
- and then `map` function takes each element of that list, transforms it with the specified function – `String::toInt` is a reference to the function `String.toInt()` – and places the results of transformation to a new list of ints.
