This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-08-14 12:13:40

BlueTaslem
Scratcher
Registered: 2010-07-23
Posts: 12

String Handling

There should be additions for basic string-handling operators.

Replace (string,strold,strnew): Replaces all occurances of 'strold' in 'string' with 'strnew'
Substring (string, start, end): The part of the string starting at position 'Start' and ending at position 'End'.

These three could probably be in one block, like the 'other' math operators are:
Lower(string): The lowercase version of the string
Upper(string): The uppercase version of the string
Reverse(string): The reversed string (reading backwards)

Offline

 

#2 2010-08-14 12:52:01

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: String Handling

Absolutely! I suppose you can write basic versions of these functions yourself, but they would be painfully slow... Basic string operations are a must for the next version of Scratch.

Offline

 

#3 2010-08-14 14:31:13

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: String Handling

Definitely. Parsing a string in Scratch is not fun. I'd love for this to be implemented.

Last edited by Harakou (2010-08-14 14:31:26)


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#4 2010-08-14 19:26:35

BlueTaslem
Scratcher
Registered: 2010-07-23
Posts: 12

Re: String Handling

Thanks! Sorry about forgetting that one from the first post.

Offline

 

#5 2010-08-14 19:27:35

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Re: String Handling

Sorry but what does that all mean?


I'm graduating HS this April and going to college in the Fall.

Offline

 

#6 2010-08-14 19:36:32

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: String Handling

I agree 100%.  big_smile

This would really help with writing your own programming languages in Scratch.  wink


-End Transmission-

Offline

 

#7 2010-08-14 19:37:14

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: String Handling

steppenwulf wrote:

Sorry but what does that all mean?

A string is basically a variable that's text rather than numbers: for instance, "the" is a string.

This suggestion involves changing these numbers in certain ways: for example, capitalizing it all, searching for a string inside a string, etc.

Offline

 

#8 2010-08-14 20:27:49

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: String Handling

Sounds cool - it would save a lot of s-l-o-w-n-e-s-s.  smile


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

Board footer