---
updatedAt: 2025-05-20T20:29:04.000Z
agentTools:
  projectIndex: https://docs.documotor.com/llms.txt
---

# to_sentencecase

Convert a string to sentence case

# Definition

`string to_sentencecase(string $string)`

Converts a string to sentence case, i.e., capitalizes the first words of sentences, and sets the rest to lowercase.

# Parameters

<Glossary>string</Glossary> `$string`

String to convert to sentence case.

# Returns

<Glossary>string</Glossary>

`$string` after converting to sentence case. In the returned string, the starting letter and any letters following a period are capitalized, while the rest are set to lowercase.

# Examples

```text Transformation
{
  a: to_sentencecase('lowercase'),
  b: to_sentencecase('UPPERCASE'),
  c: to_sentencecase('An unusually CASED Sentence. or Two.'),
  d: to_sentencecase('123'),
  e: to_sentencecase(`true`),
  f: to_sentencecase(`null`)
}
```

```json Result
{
  "a": "Lowercase",
  "b": "Uppercase",
  "c": "An unusually cased sentence. Or two.",
  "d": "123",
  "e": null,
  "f": null
}
```