Modify split(String) usages within stdlib.

This commit is contained in:
Ilya Gorbunov
2015-03-24 21:23:26 +03:00
committed by Ilya Gorbunov
parent 6f7a4d8429
commit abdac27b61
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ public fun Node.previousElements(): List<Element> = previousSiblings().filterIsI
public var Element.classSet: MutableSet<String>
get() {
val answer = LinkedHashSet<String>()
val array = this.classes.split("""\s""")
val array = this.classes.split("""\s""".toRegex())
for (s in array) {
if (s.length() > 0) {
answer.add(s)
@@ -95,7 +95,7 @@ public fun File.filePathComponents(): FilePathComponents {
// Split not only by / or \, but also by //, ///, \\, \\\, etc.
val list = if (rootName.length() > 0 && subPath.isEmpty()) listOf() else
// Looks awful but we split just by /+ or \+ depending on OS
subPath.split("""\Q${File.separatorChar}\E+""").toList().map { it -> File(it) }
subPath.split("""\Q${File.separatorChar}\E+""".toRegex()).toList().map { it -> File(it) }
return FilePathComponents(rootName, list)
}