mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -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_letter_of: this.letterOf,
|
||||
operator_length: this.length,
|
||||
operator_contains: this.contains,
|
||||
operator_mod: this.mod,
|
||||
operator_round: this.round,
|
||||
operator_mathop: this.mathop
|
||||
|
@ -106,6 +107,10 @@ class Scratch3OperatorsBlocks {
|
|||
length (args) {
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue