<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@easyops-cn/brick-next-pipes](./brick-next-pipes.md) &gt; [substr](./brick-next-pipes.substr.md)

## substr() function

根据指定起始位置和长度返回一个字符串的子串。

 String

**Signature:**

```typescript
export declare function substr(value: string, from: number, length?: number): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  value | string | 字符串。 |
|  from | number | 返回的子串的起始位置。 |
|  length | number | 返回的子串的长度。 |

**Returns:**

string

子串。

## Remarks

详见 [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/String/substr](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)<!-- -->。

