ASCII char, '' (). ASCII ASCII '' (), .
If you look at the ASCII table , the characters below the space (ASCII 32) are non-printable control characters. Thus, all printable characters, except for the space, are located above ASCII space (which is 32). Therefore, if characters whose ASCII are less than or equal to the value '' (space) are deleted, we get the remaining line without leading and trailing spaces.
This is how Java works trim(). However, you can just use trim()also in Kotlin:
titleEt.text.toString().trim()
source
share