Update Member Import
This commit is contained in:
11
frontend/dashboard/src/utils/formatString.ts
Normal file
11
frontend/dashboard/src/utils/formatString.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export function clearTag(htmlString: string | undefined) {
|
||||
return htmlString?.replace(/(<([^>]+)>)/gi, "");
|
||||
}
|
||||
|
||||
export function limitString(anyString: string | undefined, limit: number = 50) {
|
||||
return anyString?.substring(0, limit)
|
||||
}
|
||||
|
||||
export function makeExcerpt(htmlString: string | undefined, limit: number = 50) {
|
||||
return limitString(clearTag(htmlString ?? ''), limit);
|
||||
}
|
||||
Reference in New Issue
Block a user