Suggest to replace 'substring' calls by take/drop/dropLast calls when possible
#KT-10196 Fixed
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
s.<spot>drop(5)</spot>
|
||||
+1
@@ -0,0 +1 @@
|
||||
s.<spot>substring(5)</spot>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention replaces 'substring' call with 'drop' call.
|
||||
</body>
|
||||
</html>
|
||||
+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 'substring' call with 'dropLast' 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 'substring' and 'indexOf' calls with 'substringAfter' 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 'substring' and 'indexOf' calls with 'substringBefore' 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 'substring' call with 'take' call.
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user