chat-ui / src /lib /utils /trimSuffix.ts
coyotte508's picture
coyotte508 HF staff
✨ Remove endoftext (#70)
0abf663 unverified
raw
history blame
165 Bytes
export function trimSuffix(input: string, end: string): string {
if (input.endsWith(end)) {
return input.slice(0, input.length - end.length);
}
return input;
}