Suggest to replace 'substring' calls by take/drop/dropLast calls when possible
#KT-10196 Fixed
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.ReplaceSubstringWithSubstringAfterIntention
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A(val x: String)
|
||||
|
||||
fun foo(a: A) {
|
||||
a.x.substring<caret>(a.x.indexOf('x'))
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A(val x: String)
|
||||
|
||||
fun foo(a: A) {
|
||||
a.x.substringAfter('x')
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(s: String) {
|
||||
s.substring<caret>(s.indexOf('x'))
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(s: String) {
|
||||
s.substringAfter('x')
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(s: String) {
|
||||
s.substring<caret>(s.indexOf('x'));
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(s: String) {
|
||||
s.substringAfter('x');
|
||||
}
|
||||
Reference in New Issue
Block a user