# Text Texts Examples of texts are: “Thing 1” “12. March 2010” “” (empty text) Text can contain letters (capital or lower case), numbers, punctuation marks, other symbols, and spaces. ### Blocks #### Creating text The following block creates the text “Hello” and saves it in the variable named **greeting:** **[![Bild1_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/6lRbild1-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/6lRbild1-e.PNG)** The block **create text with** combines the value of the variable **greeting** and the new text “world” to create the text “Helloworld.” Please note that there is no space between the two texts, since there was none in the original texts. [![Bild2_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/R7Kbild2-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/R7Kbild2-e.PNG) To increase the number of text inputs, click the (+) symbol. To remove the last output, click the (-) symbol. #### Changing text The block **to ... append** adds the entered text to the given variable. In this example, it changes the value for the variable **greeting** from “Hello” to “Hello, there!”: [![Bild4_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/9NVbild4-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/9NVbild4-e.PNG) #### Text length The **length of** block counts the number of characters (letters, numbers, etc.) contained in a text. The length of “We are #1!” is 12, and the length of the empty text is 0. [![Bild5_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/aLbbild5-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/aLbbild5-e.PNG) [![Bild6_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/hAkbild6-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/hAkbild6-e.PNG) #### Check for empty text This **is empty** block checks whether the entered text is empty (the length is 0). The result is **true** in the first example, and **false** in the second example. [![Bild7_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/6sTbild7-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/6sTbild7-e.PNG) [![Bild8_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/ltrbild8-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/ltrbild8-e.PNG) #### Search for text These blocks can be used to check whether a text is present in another text, and if so, where. For example, this block checks for the first occurrence of “e” in “Hello,” and the result is 2: [![Bild9_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/qIVbild9-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/qIVbild9-e.PNG) This one checks for the last occurrence of “e” in Hello, which is also 2: [![Bild10_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/P88bild10-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/P88bild10-e.PNG) Regardless of whether the first or last occurrence is selected, this block delivers the result 0, since “Hello” does not contain a “z.” [![Bild11_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/c02bild11-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/c02bild11-e.PNG) #### Extracting text ##### Extracting a single character This returns “b,” the second letter in “abcde”: [![Bild12_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/4AWbild12-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/4AWbild12-e.PNG) This returns “d,” the next to last letter in “abcde”: [![Bild13_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/L5Bbild13-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/L5Bbild13-e.PNG) This returns “a,” the first letter in “abcde”: [![Bild14_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/zPgbild14-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/zPgbild14-e.PNG) This returns “e,” the last letter in “abcde”: [![Bild15_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/bild15-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/bild15-e.PNG) This contains each of the 5 letters in “abcde” with the same probability: [![Bild16_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/bild16-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/bild16-e.PNG) None of them changes the text from which these results are extracted. #### Extracting a text range The **in text ... get substring from** block can be used to extract a text range that either starts with: - letter # - letter # from end - first letter and ends with: - letter # - letter # from end - last letter In the following example, “abc” is extracted: [![Bild17_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/bild17-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/bild17-e.PNG) #### Change text capitalization This block generates a version of the input text either written in - UPPER CASE (all letters in caps) or - lower case (all letters as lower case), or - Substantive (first letters capitalized, other letters lower case). The result of the following block is “HELLO”: [![Bild18_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/bild18-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/bild18-e.PNG) Non-alphabetic characters are not affected. Please note that this block does not work on text in languages without capital and lower case letters, like Chinese. #### Trimming (removing) spaces The following block removes spaces, depending on the settings in the drop down menu (small triangle): - at the start of the text - at the end of the text - on both sides of the text The result of the following block is “Hi you.” [![Bild19_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/bild19-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/bild19-e.PNG) Spaces in the middle of the text are not affected. #### Print text The **print** block causes the input value in the console window to be printed: [![Bild20_e.PNG](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/bild20-e.PNG)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/bild20-e.PNG) It is never sent to the printer, although the name might seem to indicate this. #### Output text with formatting You can use the **formatted text** block to output texts with formatted variable content. All place holders **{}** in the text are replaced with the content of the variables appended after the text. Formatting can be entered into the brackets. The formatting **{:.1f}**, for instance, outputs only the first decimal place in the variable **t**. [![image-1638518243441.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/scaled-1680-/image-1638518243441.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2021-12/image-1638518243441.png)