mirror of
https://github.com/aNNiMON/Own-Programming-Language-Tutorial.git
synced 2024-09-20 00:34:20 +03:00
Исправлена функция lastIndexOf
This commit is contained in:
parent
506760a02e
commit
e08f1d3df9
@ -10,8 +10,10 @@ public final class std_lastindexof implements Function {
|
||||
|
||||
final String input = args[0].asString();
|
||||
final String what = args[1].asString();
|
||||
final int index = (args.length == 3) ? args[2].asInt() : 0;
|
||||
|
||||
if (args.length == 2) {
|
||||
return NumberValue.of(input.lastIndexOf(what));
|
||||
}
|
||||
final int index = args[2].asInt();
|
||||
return NumberValue.of(input.lastIndexOf(what, index));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user