how long is a piece of string
smurfted
Member, PRO Posts: 586
If i have a text string (attribute or a table entry), is it possible to make it one character shorter.
So for example "blob" would become "blo"..
Comments
Try using the following functions:
textLength (Function): This returns the length of the text or numerical attribute
textSubStr (Function): This returns a text which is the substring of attribute, text, starting from index startIndex and ending at index endIndex.
Usage: Given a text attribute with the value “the quick sly fox jumped over the lazy dog.”
textSubStr(self.Text ,5,8) returns the value “quic”. You can also use this to extract a random set of numbers from a string and use that as a way to choose a unique question via table row number.
http://help.gamesalad.com/gamesalad-cookbook/1-getting-started/1-11-glossary/
So it would be something like this: textSubStr(self.Text, 1, textLength(self.Text) - 1)
works like a dream, you sir are epic..