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:
Dmitry Jemerov
2016-01-15 19:52:35 +01:00
52 changed files with 612 additions and 0 deletions
@@ -0,0 +1 @@
s.<spot>dropLast(5)</spot>
@@ -0,0 +1 @@
s.<spot>substring(0, s.length - 5)</spot>
@@ -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>
@@ -0,0 +1 @@
s.<spot>substringAfter('x')</spot>
@@ -0,0 +1 @@
s.<spot>substring(s.indexOf('x'))</spot>
@@ -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>
@@ -0,0 +1 @@
s.<spot>substringBefore('x')</spot>
@@ -0,0 +1 @@
s.<spot>substring(0, s.indexOf('x'))</spot>
@@ -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>
@@ -0,0 +1 @@
s.<spot>take(10)</spot>
@@ -0,0 +1 @@
s.<spot>substring(0, 10)</spot>
@@ -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>