Files
common/packages/util/src/string/upperFirst.ts
T
Jaco Greeff f07d66562b Remove default exports (#755)
* Remove default exports

* Cleanup tests

* Exports in util

* Single secp256k1 instance

* Length check

* format check

* encoded lengths
2020-11-08 18:07:31 +01:00

24 lines
601 B
TypeScript

// Copyright 2017-2020 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
/**
* @name stringUpperFirst
* @summary Lowercase the first letter of a string
* @description
* Lowercase the first letter of a string
* @example
* <BR>
*
* ```javascript
* import { stringUpperFirst } from '@polkadot/util';
*
* stringUpperFirst('abc'); // => 'Abc'
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export function stringUpperFirst (value?: String | string | null): string {
return value
? value.charAt(0).toUpperCase() + value.slice(1)
: '';
}