> For the complete documentation index, see [llms.txt](https://racoon-js.gitbook.io/zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://racoon-js.gitbook.io/zh/jie-kou-shuo-ming/string/min.md).

# min

min(limit, \[closed=true])

## 作用

限制被检测字符串长度的最小值。

## 参数

* `limit`***(number)***  - 长度的最小值
* `[closed]`***(boolean)*****&#x20;-** 是否闭区间，默认`true`, 表示闭区间，被检测字符串长度需大于或等于`limit`. 若`closed`明确为`false`, 则表示开区间，被检测字符串长度必须严格大于`limit`.

## 示例

```javascript
const schema = racoon.string().min(3);
schema.validate('ab'); // fail
schema.validate('abc'); // pass
schema.validate('abcd'); // pass

const schema2 = racoon.string().min(3, false);
schema2.validate('ab'); // fail
schema.validate('abc'); // fail
schema.validate('abcd'); // pass
```
