Discuss Scratch

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)

Thepuzzlegame
Scratcher
1000+ posts

If a string contains something.

Support!
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)
(string () contains [...] ::operators)
Centrifugal
Scratcher
500+ posts

If a string contains something.

Support
RPFluffy
Scratcher
1000+ posts

If a string contains something.

Thepuzzlegame wrote:

Kiwi!

Centrifugal wrote:

Kiwi

SurgeForce wrote:

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
stickfiregames
Scratcher
1000+ posts

If a string contains something.

Support.
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
(position of [substring] in [epic substring plus some more stuff]::operators) // returns -1 for not found, 1 to length(2nd param) if found
(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)
I could go on and on…

Last edited by MegaApuTurkUltra (Sept. 22, 2014 16:37:08)

OmnipotentPotato
Scratcher
1000+ posts

If a string contains something.

Kiwi?
TheHockeyist
Scratcher
1000+ posts

If a string contains something.

OmnipotentPotato wrote:

Kiwi?

Kiwi = that user's way of saying Support.
MegaApuTurkUltra
Scratcher
1000+ posts

If a string contains something.

TheHockeyist wrote:

OmnipotentPotato wrote:

Kiwi?

Kiwi = that user's way of saying kiwi.
Also, this is proof that people don't actually read sigs

Last edited by MegaApuTurkUltra (Sept. 22, 2014 16:35:32)

DrJacket
Scratcher
17 posts

If a string contains something.

Support.
TheHockeyist
Scratcher
1000+ posts

If a string contains something.

MegaApuTurkUltra wrote:

TheHockeyist wrote:

OmnipotentPotato wrote:

Kiwi?

Kiwi = that user's way of saying kiwi.
Also, this is proof that people don't actually read sigs
Seriously guys, stop misquoting people. Kiwi does not sound anything like support. And besides, I don't even like kiwis (the food).

Last edited by TheHockeyist (Sept. 22, 2014 17:12:11)

anythingispossible
Scratcher
100+ posts

If a string contains something.

I support!
MegaApuTurkUltra
Scratcher
1000+ posts

If a string contains something.

TheHockeyist wrote:

…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)

samanyolu
Scratcher
1000+ posts

If a string contains something.

Support.
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)

TheHockeyist
Scratcher
1000+ posts

If a string contains something.

Bump.
theonlygusti
Scratcher
1000+ posts

If a string contains something.

TheHockeyist wrote:

MegaApuTurkUltra wrote:

TheHockeyist wrote:

OmnipotentPotato wrote:

Kiwi?

Kiwi = that user's way of saying kiwi.
Also, this is proof that people don't actually read sigs
Seriously guys, stop misquoting people. Kiwi does not sound anything like support. And besides, I don't even like kiwis (the food).
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.

Also, I support this idea! And also agree that there should be loads of string functions.
robosnakejr
Scratcher
1000+ posts

If a string contains something.

Support.
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.

Powered by DjangoBB