So, i would like to make:
''Hey dude!''
into
''HeY DUdE'' (or similar)
using a script.
Using my pre-existant knowledge of how to do this in python, for the first step, i tried splitting a string into characters, and place them into an array:
text = 'Hey dude!' tt = {} for i = 1,#text do table.insert(tt, text[i]) end for i = 1,#tt do --Debug print(tt[i]) end
However, this script will not fill the list.
Any ideas on how to make this work would be great. Thanks.
you have the right idea, but you're executing it wrong.
text doesn't support keys that are meant to point to a character in a string. instead, use textObject:sub(n, n)
. using the same number for the start and end point will allow to capture the character that has the same position value as n.
for example:
local String = "Hello, World!"; print(String:sub(1,1)) --//H