mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Add string contains string
This commit is contained in:
parent
3beebdc7be
commit
3b601e8595
1 changed files with 5 additions and 0 deletions
|
@ -30,6 +30,7 @@ class Scratch3OperatorsBlocks {
|
||||||
operator_join: this.join,
|
operator_join: this.join,
|
||||||
operator_letter_of: this.letterOf,
|
operator_letter_of: this.letterOf,
|
||||||
operator_length: this.length,
|
operator_length: this.length,
|
||||||
|
operator_contains: this.contains,
|
||||||
operator_mod: this.mod,
|
operator_mod: this.mod,
|
||||||
operator_round: this.round,
|
operator_round: this.round,
|
||||||
operator_mathop: this.mathop
|
operator_mathop: this.mathop
|
||||||
|
@ -107,6 +108,10 @@ class Scratch3OperatorsBlocks {
|
||||||
return Cast.toString(args.STRING).length;
|
return Cast.toString(args.STRING).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contains (args) {
|
||||||
|
return Cast.toString(args.STRING1).includes(Cast.toString(args.STRING2));
|
||||||
|
}
|
||||||
|
|
||||||
mod (args) {
|
mod (args) {
|
||||||
const n = Cast.toNumber(args.NUM1);
|
const n = Cast.toNumber(args.NUM1);
|
||||||
const modulus = Cast.toNumber(args.NUM2);
|
const modulus = Cast.toNumber(args.NUM2);
|
||||||
|
|
Loading…
Reference in a new issue