⚠️This site is a mirror of Guy Walker's Stagecast⚠️

Text Functions Calculator - Guide

The Stagecast calculator can perform text functions on words, items and characters. This sim makes it easy to test and see the results of various operations.

The central blue and pink buttons replicate the Stagecast calculator 'Text Functions' panel.

TFC Stage

Play Sim     View Stage


Text 'types'

There are 3 different 'types' of text function.

1/ Word Functions

Text separated with spaces, is a series of words, as in a sentence.
Example sentences are:

The animals went in 2 by 2.
This is not a sentence.
4 o'clock on Christmas Day 2009.

2/ Item Functions

Text separated with commas is a list of items. Useful for objects collected in an RPG game.
Example lists are:

coin,arrow,key,coin,coin,
red,green,blue,yellow,
up,down,up,right,left,right,right,

3/ Character Functions

Text is a string of characters, as in a word (or number).
Example strings are:

USofA
east-west-path
cash4trash
3.14159
Ben&Dale-part2

It is best to use only one type of separator (space or comma) in your text. Or none at all if your text is a string.

Remember, you can use keyboard short cut keys to copy and paste hi-lighted text.


Text function buttons

Click in the top text box to display the flashing text cursor. Type in your text and press the keyboard <enter> key.

The first column of blue buttons will append (join) a word, item or character, (contained in the white box), to the end of your text.

The second (middle) column of blue buttons will display the word, item or character at a specified location in your text. Enter the location number in the white box directly above the buttons.
If your requested location is too high then the box will be empty. The TFC will display <EMPTY>.
If the box contains a space character, the TFC will display <SPACE>.

The third column of blue buttons will remove a word, item or character from a specified location. Enter the location number in the white box directly above the buttons.
If your request is too high then no change is made.

The right-hand column of pink buttons will count the number of words, items or characters in your text and display the result in the gray box directly below the buttons.

The final blue button in the first column is a bit different. It removes the last occurrence of a string from your text. Enter the string (which may include spaces or commas) in the white box directly above the buttons.


Text tools

The contains? button allows you to test if your text contains a specific string. Enter the string (which may include spaces or commas) in the white box and press the test button, which will show yes (green) or no (red).

The rev button will reverse your text. It first works out the 'type' of text.

If the text contains one or more commas, it is treated as a list of items (button shows i).
If the text is a single word, it is treated as a string of characters (button shows c).
Else the text is treated as a sentence of words (button shows w).

Finally the top info button links to this page.

Note

There are no special reserved characters to avoid in your text.

Text always contains at least one word, item or character. It probably prevents 'divide-by-zero' errors. Removing an item or word from text with only one item or word deletes the whole text.

A two item list such as 12,13 contains the numbers 1, 2 and 3.

A list such as as,,df has an empty second list item . It can cause errors because item# will ignore it but #of items will count it.

Let me know any other 'interesting' features you find.

Sims