---
title: "Helpers/string"
---
# Helpers/string

### camelCase()

**camelCase**(`key`): `string`

Defined in: [src/core/helpers/string/camel-case.ts:14](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/camel-case.ts#L14)

Convert (kebab-case or snake_case) to camelCase

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `key` | `string` |

#### Returns

`string`

***

### fuzzySearchIndex()

**fuzzySearchIndex**(`needle`, `haystack`, `offset?`, `maxDistance?`): \[`number`, `number`\]

Defined in: [src/core/helpers/string/fuzzy-search-index.ts:17](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/fuzzy-search-index.ts#L17)

Finds the position of the substring in the string, if any, and returns the length of the found subsequence.
Unlike `indexOf` ignores INVISIBLE_SPACE and may fail at `maxDistance` characters

#### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `needle` | `string` | `undefined` |
| `haystack` | `string` | `undefined` |
| `offset` | `number` | `0` |
| `maxDistance` | `number` | `1` |

#### Returns

\[`number`, `number`\]

***

### sprintf()

**sprintf**(`str`, `args?`): `string`

Defined in: [src/core/helpers/string/i18n.ts:24](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/i18n.ts#L24)

Simple variant sprintf function

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `str` | `string` |
| `args?` | (`string` \| `number`)[] |

#### Returns

`string`

***

### i18n()

**i18n**(`key`, `params?`, `options?`): `string`

Defined in: [src/core/helpers/string/i18n.ts:69](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/i18n.ts#L69)

Internationalization method. Uses Jodit.lang object

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `key` | `string` |
| `params?` | (`string` \| `number`)[] |
| `options?` | [`ILanguageOptions`](../interfaces/types.ILanguageOptions.html) |

#### Returns

`string`

#### Example

```javascript
var editor = Jodit.make("#redactor", {
     language: 'ru'
});
console.log(editor.i18n('Cancel')) //Отмена;

Jodit.defaultOptions.language = 'ru';
console.log(Jodit.prototype.i18n('Cancel')) //Отмена

Jodit.lang.cs = {
   Cancel: 'Zrušit'
};
Jodit.defaultOptions.language = 'cs';
console.log(Jodit.prototype.i18n('Cancel')) //Zrušit

Jodit.lang.cs = {
   'Hello world': 'Hello \s Good \s'
};
Jodit.defaultOptions.language = 'cs';
console.log(Jodit.prototype.i18n('Hello world', 'mr.Perkins', 'day')) //Hello mr.Perkins Good day
```

***

### kebabCase()

**kebabCase**(`key`): `string`

Defined in: [src/core/helpers/string/kebab-case.ts:11](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/kebab-case.ts#L11)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `key` | `string` |

#### Returns

`string`

***

### CamelCaseToKebabCase()

**CamelCaseToKebabCase**(`key`): `string`

Defined in: [src/core/helpers/string/kebab-case.ts:19](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/kebab-case.ts#L19)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `key` | `string` |

#### Returns

`string`

***

### stringify()

**stringify**(`value`, `options?`): `string`

Defined in: [src/core/helpers/string/stringify.ts:16](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/stringify.ts#L16)

Safe stringify circular object

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `unknown` |
| `options` | \{ `excludeKeys?`: `string`[]; `prettify?`: `string`; \} |
| `options.excludeKeys?` | `string`[] |
| `options.prettify?` | `string` |

#### Returns

`string`

***

### trim()

**trim**(`value`): `string`

Defined in: [src/core/helpers/string/trim.ts:22](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/trim.ts#L22)

It clears the line of all auxiliary invisible characters , from the spaces and line breaks , tabs
from the beginning and end of the line

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |

#### Returns

`string`

***

### trimChars()

**trimChars**(`value`, `chars`): `string`

Defined in: [src/core/helpers/string/trim.ts:28](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/trim.ts#L28)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |
| `chars` | `string` |

#### Returns

`string`

***

### trimInv()

**trimInv**(`value`): `string`

Defined in: [src/core/helpers/string/trim.ts:37](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/trim.ts#L37)

Trim only invisible chars

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |

#### Returns

`string`

***

### ucfirst()

**ucfirst**(`value`): `string`

Defined in: [src/core/helpers/string/ucfirst.ts:14](https://github.com/xdan/jodit/blob/main/src/core/helpers/string/ucfirst.ts#L14)

Make a string's first character uppercase

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |

#### Returns

`string`
