> For the complete documentation index, see [llms.txt](https://inscada.gitbook.io/ins/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inscada.gitbook.io/ins/en-1/programing/apis/string-functions.md).

# String Functions

String Functions are used to edit string variable values in script/expression on the inSCADA platform.

## Left Padding Of a String

#### ins.leftPad(integer val,integer length,String padchars)

Places characters to the left of a number along the given string length.

integer val : Number.

integer length: The length of the string to be created.

String padchars: The character to be placed on the left side of the String.

Return Value: Returns a new string value.

#### Syntax

```javascript
var val=12.23;
var str=ins.leftPad(val,7,"0");
ins.notify("info",val,str);

// Return Value
// 0012.23
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://inscada.gitbook.io/ins/en-1/programing/apis/string-functions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
