---
title: isString
nav:
  title: Tools
  path: /tools
group:
  title: Types
toc: content
---

## isString

Demo:

```tsx
/**
 * title: 基础用法
 * description: 判断是否为 string 类型函数
 */

import React from 'react';
import { isString } from 'aim-tools';

const result1 = isString('');
const result2 = isString();
const result3 = isString(12);

export default () => (
  <pre>
    <code>
      isString(''); // {result1.toString()}
      <br />
      <br />
      isString(); // {result2.toString()}
      <br />
      <br />
      isString(12); // {result3.toString()}
    </code>
  </pre>
);
```

### API

```typescript
isString(str?: any);
```

### Params

| 参数 | 说明           | 类型 | 默认值 | 必填 |
| :--- | :------------- | :--- | :----- | :--- |
| str  | 需要判断的数据 | any  | -      | 否   |

### Returns

| 返回值 | 说明                       |
| :----- | :------------------------- |
| true   | 该数据是 string 类型数据   |
| false  | 该数据不是 string 类型数据 |
