# lowerCase

### 说明

&#x20;转换字符串`string`以空格分开单词, 并转换为`小写`

### 源码

<https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/string/lowerCase>

### 用法

{% code title="lowerCase.test.ts" %}

```typescript
import { lowerCase } from "../../utility/string/lowerCase";

describe('lowerCase tests...', () => {

  test('lowerCase should return `` when receive an empty string', () => {
    const received = '';
    const expected = '';

    const result = lowerCase(received);

    expect(result).toBe(expected);
  });

  test('lowerCase should return the converted string correctly', () => {
    const received = ['--Duan-Zhao--', 'alioeDuan', '__DUAN_ZHAO_YANG__'];
    const expected = ['duan zhao', 'alioeduan', 'duan zhao yang'];

    received.forEach((v, i) => {
      const result = lowerCase(v);

      expect(result).toBe(expected[i]);
    });
  });

});
```

{% endcode %}


---

# Agent Instructions: 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:

```
GET https://ddzy.gitbook.io/ts-utility-plugins-docs/utility/utility-string/lowercase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
