Using Director > Text > Modifying strings with Lingo

 

Modifying strings with Lingo

As time passes or other conditions change, you may want to update and change text. For example, you may want to frequently update a text sprite that displays the user's name or a description of a musical selection that the user is currently streaming from a Web site.

To set the entire content of a text or field cast member, set the text cast member property to a new chunk of text. The chunk can be a string or another text cast member. See text.

To combine character strings, use the & and && operators. The & operator attaches the second string to the end of the first string. The && operator includes a space between two strings when they are combined. See & (concatenator) and && (concatenator).

To insert a string of characters into another string, use the put...after, put...into, or put...before command. The put...before command places the string at the beginning of another string. The put...into command replaces a specified chunk expression with another chunk expression. The put...after command places the string at the end of another string. See put...after, put...before, and put...into.

To delete a chunk expression from a string of text, use the delete command. See delete.