Skip to content

@technobuddha > library > String > Deconstruction

Function: root() ​

ts
function root(text: string, options: RootOptions): string;

Defined in: root.ts:21

Extract the root word, removing a prefix and/or suffix

Parameters ​

ParameterTypeDescription
textstringThe word, which might have
optionsRootOptionssee RootOptions

Returns ​

string

The root word

See ​

  • prefix before it, and
  • suffix after it.