Let's first talk about the special characters that need to be escaped in java. These characters are:
( [ { / ^ - $ ¦ } ] ) ? * + .
But these characters don't need to be escaped in kotlin.
1. Directly String.split() under the Android kotlin file
var arr = "aa|bb|cc".split("|")
You can get arr = {"aa", "bb", "cc"}
There is no need to escape special symbols.
2. Escaping is required under the Android java file, please see the attention points (escaping characters) of java splitting string String.split() method_java separator escaping_ErwinNakajima's blog-CSDN blog