This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CastleMan2000's profile picture

String Stuff?

Started by CastleMan2000, 28 July 2012 - 07:16 PM
CastleMan2000 #1
Posted 28 July 2012 - 09:16 PM
How do I do things like separate words and count letters with strings? I'm thinking of taking a string and loading the separate words into a table, and then counting the number of and identifying letters and encrypting the string based on that. Do I use a string API or something?
MysticT #2
Posted 28 July 2012 - 09:26 PM
You can use the string api. It's standard lua, so there's plenty tutorials out there, and it's on the lua manual.
To separate the words, check the shell program (inside rom/programs). At the bottom, inside the loop, it has the code to separate the words (it uses that to call the programs with arguments).

Here's a good tutorial: link.