UNPKG

@eslam-elmeniawy/react-native-common-components

Version:

Common `ReactNative` components packed in library for usage in projects.

11 lines (10 loc) 490 B
"use strict"; /** * Trims a given string to a specified length, appending '...' if the string exceeds the length. * * @param string - The string to be trimmed. * @param length - The maximum length of the trimmed string, default is 45. * @returns The trimmed string, with '...' appended if it was truncated. */ export const trimStringToLength = (string, length = 45) => string.length > length ? string.substring(0, length - 3) + '...' : string; //# sourceMappingURL=StringUtils.js.map