Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Duplicated from
huggingchat/chat-ui
Bnr32
/
chat-ui
like
0
Running
App
Files
Files
Community
9b20b88
chat-ui
/
src
/
lib
/
utils
/
trimPrefix.ts
coyotte508
HF staff
✨ Remove endoftext (#70)
0abf663
unverified
over 1 year ago
raw
Copy download link
history
blame
Safe
150 Bytes
export
function
trimPrefix
(
input:
string
, prefix:
string
) {
if
(input.
startsWith
(prefix)) {
return
input.
slice
(prefix.
length
);
}
return
input;
}