Some formatting preserving for special methods too

This commit is contained in:
Valentin Kipyatkov
2016-10-01 02:36:15 +03:00
parent f4d9909f6f
commit 5a6f068130
10 changed files with 144 additions and 67 deletions
@@ -72,13 +72,20 @@ internal class A {
fun specialMethods() {
val s = "test string"
s == "test"
s.equals("tesT", ignoreCase = true)
s.equals(
"tesT", ignoreCase = true
)
s.compareTo("Test", ignoreCase = true)
s.regionMatches(0, "TE", 0, 2, ignoreCase = true)
s.regionMatches(
0,
"TE",
0,
2, ignoreCase = true
)
s.regionMatches(0, "st", 1, 2)
s.matches("\\w+".toRegex())
s.replace("\\w+".toRegex(), "---")
s.replaceFirst("([s-t])".toRegex(), "A$1")
.replaceFirst("([s-t])".toRegex(), "A$1")
useSplit(s.split("\\s+".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray())
useSplit(s.split("\\s+".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray())
useSplit(s.split("\\s+".toRegex()).toTypedArray())
@@ -105,7 +112,11 @@ internal class A {
3.14.toString()
Any().toString()
String.format(Locale.FRENCH, "Je ne mange pas %d jours", 6)
String.format(
Locale.FRENCH,
"Je ne mange pas %d jours",
6
)
String.format("Operation completed with %s", "success")
val chars = charArrayOf('a', 'b', 'c')