ID:267374
 
Ok if I have a text string like Hello World, and the 2nd l in Hello World, that would be the 4th letter, how can I get BYOND to find this out with any text string?
DBZ Kidd wrote:
Ok if I have a text string like Hello World, and the 2nd l in Hello World, that would be the 4th letter, how can I get BYOND to find this out with any text string?

Check out findtext()/findText()/copytext().

Ooh, now that the Blue Book is online, we can point to it:

http://www.byond.com/docs/guide/chap15.html
DBZ Kidd wrote:
Ok if I have a text string like Hello World, and the 2nd l in Hello World, that would be the 4th letter, how can I get BYOND to find this out with any text string?

Aside from copytext(), you can also use text2ascii() to find the ASCII value of a character at a particular index.
if(text2ascii(uppertext(msg),4)==76)
world << "L is the 4th letter of \"[msg]\"."

Lummox JR