Add string contains string

This commit is contained in:
Ken 2017-08-11 00:52:41 +12:00 committed by GitHub
parent 3beebdc7be
commit 3b601e8595

View file

@ -30,6 +30,7 @@ class Scratch3OperatorsBlocks {
operator_join: this.join,
operator_letter_of: this.letterOf,
operator_length: this.length,
operator_contains: this.contains,
operator_mod: this.mod,
operator_round: this.round,
operator_mathop: this.mathop
@ -107,6 +108,10 @@ class Scratch3OperatorsBlocks {
return Cast.toString(args.STRING).length;
}
contains (args) {
return Cast.toString(args.STRING1).includes(Cast.toString(args.STRING2));
}
mod (args) {
const n = Cast.toNumber(args.NUM1);
const modulus = Cast.toNumber(args.NUM2);