Discuss Scratch
- Discussion Forums
- » Suggestions
- » If a string contains something.
- TheHockeyist
-
Scratcher
1000+ posts
If a string contains something.
(string () contains [] :: operators)The string will come from a variable, so you could have "if string (variable1) contains [hello] then do this", for instance.
Last edited by TheHockeyist (Sept. 21, 2014 22:35:09)
- SurgeForce
-
Scratcher
100+ posts
If a string contains something.
Support!, oh and by the way, if you want it to be round simply put the whole thing in parentheses
Like this: (string () contains :: operators)
Like this: (string () contains :: operators)
(string () contains [...] ::operators)
- RPFluffy
-
Scratcher
1000+ posts
If a string contains something.
Kiwi!
Kiwi
Kiwi!, oh and by the way, if you want it to be round simply put the whole thing in parentheses
Like this: (string () contains :: operators)
KIWI
- MegaApuTurkUltra
-
Scratcher
1000+ posts
If a string contains something.
Support! Scratch needs more string functions in general because implementing them yourself (like I had to do in one of my projects) is annoying!
How about
How about
(position of [substring] in [epic substring plus some more stuff]::operators) // returns -1 for not found, 1 to length(2nd param) if foundI could go on and on…
(slice [epic string] at (2) to (3)::operators) // same as substring() in JS/Java/PHP/etc
<is uppercase [l]?::operators> // true if the letter is uppercase, otherwise false
([epic string] as all [uppercase/lowercase v]::operators)
// and how about byte/char conversions for hash functions
(number (67) as character::operators)
(letter [s] as number::operators)
Last edited by MegaApuTurkUltra (Sept. 22, 2014 16:37:08)
- TheHockeyist
-
Scratcher
1000+ posts
If a string contains something.
Kiwi?
Kiwi = that user's way of saying Support.
- MegaApuTurkUltra
-
Scratcher
1000+ posts
If a string contains something.
Also, this is proof that people don't actually read sigsKiwi?
Kiwi = that user's way of saying kiwi.
Last edited by MegaApuTurkUltra (Sept. 22, 2014 16:35:32)
- TheHockeyist
-
Scratcher
1000+ posts
If a string contains something.
Seriously guys, stop misquoting people. Kiwi does not sound anything like support. And besides, I don't even like kiwis (the food).Also, this is proof that people don't actually read sigsKiwi?
Kiwi = that user's way of saying kiwi.
Last edited by TheHockeyist (Sept. 22, 2014 17:12:11)
- MegaApuTurkUltra
-
Scratcher
1000+ posts
If a string contains something.
…I don't even like kiwis (the food).*gasp*
Ok ok from now on I'll stay on topic
Last edited by MegaApuTurkUltra (Sept. 22, 2014 18:01:58)
- ninjagolloyd
-
Scratcher
500+ posts
If a string contains something.
Yes, I support!
when green flag clicked
set [variable1 v] to (answer)
if <string (variable1) contains [hello] :: operators>
This is good :: motion
Else
Not good! :: red
Last edited by ninjagolloyd (Sept. 22, 2014 18:23:16)
- theonlygusti
-
Scratcher
1000+ posts
If a string contains something.
I love kiwis! And did you know, they used to be called the chinese gooseberry? I noticed this once when making gooseberry jam, the smell and look reminded me of kiwis.Seriously guys, stop misquoting people. Kiwi does not sound anything like support. And besides, I don't even like kiwis (the food).Also, this is proof that people don't actually read sigsKiwi?
Kiwi = that user's way of saying kiwi.
Also, I support this idea! And also agree that there should be loads of string functions.
- Langdon35
-
Scratcher
500+ posts
If a string contains something.
So this is like dissecting a sentence into letters, and then checking if it contains a certain character, and if it does, it returns true?
I feel that you could easily make this with custom blocks: NO SUPPORT
Ok, maybe a little.
I feel that you could easily make this with custom blocks: NO SUPPORT
Ok, maybe a little.
- Discussion Forums
- » Suggestions
-
» If a string contains something.















