mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -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
|
||||||
|
@ -106,6 +107,10 @@ class Scratch3OperatorsBlocks {
|
||||||
length (args) {
|
length (args) {
|
||||||
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);
|
||||||
|
|
Loading…
Reference in a new issue