# String Operations

This function block offers a collection of common text transformations and checks. Choose a method from the dropdown and the block will adapt its inputs and outputs to match the selected operation. It is ideal for cleaning, parsing, searching and preparing textual data for logging or further processing.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`String` Main text to process (primary input).\
Note: The exact input sockets change depending on the selected method. For example, some methods add a second `String` input for a substring or a separator, or allow multiple string inputs.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`String` / `Number` / `Boolean` / other types depending on the selected method.\
Note: Outputs update to reflect the selected operation — e.g. a count returns a number, membership check returns a boolean, split returns a list of strings.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Method` A dropdown list where you select which text operation to apply. The available choices include, for example: `Upper`, `Lower`, `Count`, `Merge`, `Split`, `Replace`, `Length`, `StartsWith`, `EndsWith`, `Join`, `Reverse`, `Remove Digits`, and more.

When you change the `Method`, the block adjusts its visible inputs and outputs automatically to match the selected operation.

## 🎨 Features <a href="#features" id="features"></a>

* `Adaptive Sockets` Inputs and outputs change dynamically based on the chosen method so you only see the controls you need.
* `Wide Method Library` Includes string case conversion, searching, splitting/joining, replacements, checks (isdigit/isalpha/etc.), trimming and utility operations like length and reverse.
* `Simple UI` Choose an operation and connect the required string inputs — no scripting required.

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. Select the desired operation from the `Method` dropdown.
2. Connect the main text source to the `String` input. If the chosen operation needs extra values (e.g. a substring or separator), additional input sockets will appear — provide those.
3. Read the result from the block outputs shown on the block. The output type depends on the selected operation (text, number, boolean, or list).

Examples:

* Use `Upper` to convert text to uppercase.
* Use `Replace` to substitute a substring with another. Provide the main text and the old/new substring inputs.
* Use `Split` to produce a list of substrings by giving a separator.

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

When run, this block applies the chosen textual operation to the input values and returns results on the matching output sockets. If inputs are missing, the block shows the last valid result where possible.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Combine with `String Input` to provide manual text values when testing or building small prototypes.
* Use `Find Substring` and `Replace` in sequence to locate and transform specific parts of a text before logging or exporting.
* Send results to `Data to JSON` or `CSV Export` when you need to log processed text for later analysis or reporting.
* Use `Debug Input` to quickly inspect intermediate text values while building your flow.
* If your text output will be shown to users, apply `Strip` or `Title Case` to tidy formatting before exporting or displaying.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* If expected inputs disappear after changing the `Method`, re-open the block and re-connect the newly visible inputs — the sockets are intentionally adaptive.
* If a numeric or boolean result is expected but you see text, confirm you selected the correct `Method` (some methods return different data types).
* For unexpected empty outputs, check upstream blocks that provide the input text (such as `String Input` or data read blocks) and use `Debug Input` to verify values.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/function-blocks/data-logic/data-operations/string-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
