Skip to content

@technobuddha > library > String > Analysis

Function: syllables()

ts
function syllables(input: string): number;

Defined in: syllables.ts:17

Approximate the number of syllables in a string

Parameters

ParameterTypeDescription
inputstringThe string

Returns

number

the number of syllables

Example

typescript
syllables('hello'); // 2
syllables('syllable'); // 3