Skip to content

Commit

Permalink
✨ create trucate_string utils
Browse files Browse the repository at this point in the history
  • Loading branch information
EuCarlos committed Nov 16, 2022
1 parent e741124 commit 4da0575
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/trucate_string.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export function trucateString(text_value: string, text_length: number):string {
if(text_value.length <= text_length)
return text_value
else
return text_value.slice(0, text_length) + '...'
}

0 comments on commit 4da0575

Please sign in to comment.