<@U29NJHBRP>, the first one splits on any characte...
# announcements
m
@leonardootto, the first one splits on any character (the '.' matches any character). The second splits only on an actual dot.
👍 1
k
@leonardootto See what I mean about crossposting? This is the third time someone answers this exact question.
👍 1
r
The second splits only on an actual dot
@leonardootto do you have a good example. I try it to understand:
Copy code
// Kotlin
"My.Text".split(".")
["My", "Text"]

// Kotlin
"My.Text".split(".".toRegex())
[, , , , , , , ] // empty array

// Java
"My.Text".split("[.]")
["My", "Text"]

// Java
"My.Text".split(".")
[]