src.app.shared.tools.string-utils.ts Maven / Gradle / Ivy
The newest version!
/*
* SPDX-FileCopyrightText: 2017-2024 Enedis
*
* SPDX-License-Identifier: Apache-2.0
*
*/
export function isNullOrEmptyString(text: string) {
return text == null || text.length === 0;
}
export function isNullOrBlankString(text: string) {
return text == null || text.trim().length === 0;
}
export function escapeHtml(text: string): string {
return text
.replace(/&/g, '&')
.replace(//g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy