---
name: "BIS_fnc_trimString"
type: function
status: ok
groups: ["Strings"]
arma3_since: "1.00"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_trimString
revid: 340879
updated: 2023-05-13T21:38:38Z
---

# BIS_fnc_trimString

*Function · Strings · Arma 3 v1.00*

## Description

Get a substring out of the string.

> [!NOTE]
> **Arma 3:** Use [select](../commands/select.md#alternative-syntax-3) instead.

## Syntax

```sqf
[someText, beginning, length] call BIS_fnc_trimString
```

**Parameters:**

- `someText`: [String](../topics/String.md) - source string
- `beginning`: [Number](../topics/Number.md) (Optional, default 0) - start index; indexing starts at 0
- `length`: [Number](../topics/Number.md) (Optional, default end of string) - end index. A negative number means X chars *from the string end*

**Returns:** [String](../topics/String.md)

## Examples

### Example 1

```sqf
["dreaded_is_the_man", 0, 6] call BIS_fnc_trimString;    // will return "dreaded"
```

### Example 2

```sqf
["dreaded_is_the_man", 15] call BIS_fnc_trimString;    // will return "man"
```

### Example 3

```sqf
["dreaded_is_the_man"] call BIS_fnc_trimString;        // will return "dreaded_is_the_man"
```

## See also

[select](../commands/select.md)

## Community notes

**R3vo** — 2017-08-24

```sqf
"test" select [0, 4];                        // 0.0007 ms
["test", 0, 4] call BIS_fnc_trimString;    // 0.013 ms
```

The first method is about **18 times faster**.

<sub>Source: [BI Community Wiki — BIS fnc trimString](https://community.bistudio.com/wiki/BIS_fnc_trimString) (revision 340879).</sub>
