bank/mod.ts

8 lines
150 B
TypeScript
Raw Normal View History

2024-08-25 09:04:22 -05:00
export function truncate(s: string, len: number): string {
if (s.length >= len) {
return s.substring(0, len - 3) + '...'
} else {
return s
}
2024-08-23 23:13:03 -05:00
}