Merge pull request #808 from mcgee/KT-10196
KT-10196: Suggest to replace 'substring' calls by take/drop/dropLast calls when possible
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
s.<spot>dropLast(5)</spot>
|
||||
+1
@@ -0,0 +1 @@
|
||||
s.<spot>substring(0, s.length - 5)</spot>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention replaces call like <code>s.substring(0, s.length - x)</code> with <code>s.dropLast(x)</code> call.
|
||||
</body>
|
||||
</html>
|
||||
+1
@@ -0,0 +1 @@
|
||||
s.<spot>substringAfter('x')</spot>
|
||||
+1
@@ -0,0 +1 @@
|
||||
s.<spot>substring(s.indexOf('x'))</spot>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention replaces call like <code>s.substring(s.indexOf(x))</code> with <code>s.substringAfter(x)</code> call.
|
||||
</body>
|
||||
</html>
|
||||
+1
@@ -0,0 +1 @@
|
||||
s.<spot>substringBefore('x')</spot>
|
||||
+1
@@ -0,0 +1 @@
|
||||
s.<spot>substring(0, s.indexOf('x'))</spot>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention replaces call like <code>s.substring(0, s.indexOf(x))</code> with <code>s.substringBefore(x)</code> call.
|
||||
</body>
|
||||
</html>
|
||||
+1
@@ -0,0 +1 @@
|
||||
s.<spot>take(10)</spot>
|
||||
+1
@@ -0,0 +1 @@
|
||||
s.<spot>substring(0, 10)</spot>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention replaces call like <code>s.substring(0, x)</code> with <code>s.take(x)</code> call.
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user