Skip to content

Function: applyTextCase() ​

ts
function applyTextCase(text, textcase): string;

Experimental

Apply a Plotly font.textcase: upper / lower (locale-independent toUpperCase / toLowerCase), word caps (the first letter of each word is uppercased, the rest left as is, like CSS capitalize), or normal / unset (unchanged).

Parameters ​

ParameterType
textstring
textcaseTextFontTextCase | undefined

Returns ​

string

Example ​

ts
applyTextCase('élan vital', 'word caps'); // 'Élan Vital'

Released under the MIT License.