From 00fc8806c8323b2e63cfe67070545aafdd2cb872 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 20 Dec 2019 11:03:48 +0000 Subject: [PATCH] [Library | Trunk]: Add capitalize function on string utils git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57926 d315682c-612b-4755-9ff5-7f18f6832af3 --- utils/string-utils.class.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/string-utils.class.ts b/utils/string-utils.class.ts index fc968888..c6273c73 100644 --- a/utils/string-utils.class.ts +++ b/utils/string-utils.class.ts @@ -136,6 +136,10 @@ export class StringUtils{ const sliced = String(mystr).substr(0, size); return sliced + (String(mystr).length > size ? '...' : ''); } + + public static capitalize(value: string): string { + return value.charAt(0).toUpperCase() + value.slice(1); + } public static URLSegmentsToPath(segments: UrlSegment[]): string { let path = '';