Skip to main content

Text

Character​

A simple character block. You can type in any single ASCII character.

info

Behind the scenes, a character is represented as a number. For example, the character A is represented as the number 65. The mapping between characters and numbers is defined by the ASCII standard.

Character properties​

The character properties block tells you about a character and its qualities.

  • alphabetical: Is the character an alphabet letter?
  • alpha-numeric: Is the character either an alphabet letter or a digit?
  • ASCII: Is the character an ASCII character?
  • control: Is the character a control character? (Control characters are non-printable characters that are used to control devices such as printers.)
  • digit: Is the character a digit (0-9)?
  • graphical: Is the character printable with a visible representation? (Space is printable but not graphical.)
  • hexadecimal: Is the character a hexadecimal digit (0-9, A-F)?
  • lowercase: Is the character a lowercase alphabet letter?
  • printable: Is the character printable? (Space is printable because it produces an output.)
  • punctuation: Is the character a punctuation mark?
  • space: Is the character a space character?
  • uppercase: Is the character an uppercase alphabet letter?
  • whitespace: Is the character a whitespace character? (Space, tab, newline, etc.)

You provide a character as InputDeviceInfo, and the block will tell you if that character satisfies the selected property.

This block outputs a boolean value, which is either true or false. You can use this value in conditional statements to make decisions based on the properties of a character.

Text​

A simple text block. You can type in any string of text.

Starts/ends with​

This block checks if a piece of text starts or ends with another piece of text.

  • Text: The main piece of text you want to check.
  • Starts/Ends: Select whether you want to check the start or the end of the main text.
  • With: The smaller piece of text to look for.

This block outputs a boolean value that tells you whether the text was located based on your selection.

Length of text​

This block counts how many characters are in a piece of text. This includes all characters, so spaces and punctuation marks are also counted.

Change case​

The change case block alters the capitalisation of letters in a piece of text.

  • upper/lower: Select whether you want to convert the text to uppercase or lowercase.
  • text: The piece of text you want to convert.

String to number​

The string to number block tries to convert a piece of text that looks like a number into an actual number that you can use in calculations.

  • integer/float: Select whether you want to convert the text into an integer (whole number) or a floating-point (decimal) number.
  • text: The piece of text you want to convert.

If the text is not a valid number, the block will output 0.

Join text​

The join text block combines multiple pieces of text into a single piece of text. The output is the concatenation of all the inputs.

Append text​

The append text block adds a piece of text to the end of another piece of text. Rather than outputting a new piece of text, this block modifies the original text.

Find index​

The find index block tells you where a smaller piece of text is located within a larger one (or -1 if it can't be found).

  • text: The big piece of text to search within.
  • first/last: Select whether you want to find the first or last occurrence of the smaller text.
  • find: The smaller piece of text to look for.

This block outputs a number that represents the position of the smaller text within the larger text. The position is zero-based, so the first character is at position 0.

Substring​

The substring block extracts a smaller piece of text from a larger piece of text.

  • text: The big piece of text to extract from.
  • start: The position of the first character to include in the output.
  • end: The position of the last character to include in the output.

The start and end positions are zero-based, so the first character is at position 0. The end position is exclusive, so the character at that position is not included in the output.

Trim​

The trim block removes extra spaces from the beginning and end of a piece of text.

Replace​

The replace block swaps out a piece of text for another piece of text, wherever it appears in a larger piece of text. You can think of this as a find-and-replace operation.

  • replace: The part of the text you want to swap out.
  • with: The replacement text to swap in.
  • text: The original piece of text to modify.