# Set String

This Function returns a string with Value replacing a Source String according to a Rank and a Separator.

### Parameters

* **Source string** <*string*> - String from where to replace the substring.
* **Rank** <*numeric*> - Order of the substring to replace.
* **Separator** <*string*> - String used as a separator in the Source string, to divide it.
* **Value** <*string*> - String to use for insert or replace.

### Examples

* *Example 1*

SetString("001;Kalipso Studio;5000;Software", 2, ";","Sysdev")\
**Result** = 001;Sysdev;5000;Software

* *Example 2*

SetString("001;Kalipso Studio;5000;Software", 1, ":","Sysdev")\
**Result** = Sysdev

* *Example 3*

SetString("001;Kalipso Studio;5000;Software", 2, ":","Sysdev")\
**Result** = "001;Kalipso Studio;5000;Software:Sysdev"

{% hint style="info" %}
If the Rank is higher than the number of parts, the result will be the source string concatenated with the missing separators and the Value.
{% endhint %}

{% hint style="info" %}
If the Separator doesn’t exist and the specified Rank is 1, the result will be the Value
{% endhint %}


---

# 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://doc.sysdevmobile.com/kalipso5/developing/form/expressions/functions/functions-descriptions/string-functions/set-string.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.
