Skip to content

@technobuddha > library > String > Case Conversion

Function: matchCase() ​

ts
function matchCase(input: string, target: string): string;

Defined in: match-case.ts:19

Attempt to convert the input string into the same case as the target string

Parameters ​

ParameterTypeDescription
inputstringThe input string
targetstringThe target string

Returns ​

string

The input in the case case as the target string

Remarks ​

The best guess is made to try to figure out what case the target is in:

  • lowercase
  • UPPERCASE
  • Capitalcase
  • PascalCase