Hugging Face
Models
Datasets
Spaces
Posts
Docs
Solutions
Pricing
Log In
Sign Up
Spaces:
huggingchat
/
chat-ui
like
1.04k
Running
App
Files
Files
Community
540
101f9ef
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
No virus
150 Bytes
export
function
trimPrefix
(
input:
string
, prefix:
string
) {
if
(input.
startsWith
(prefix)) {
return
input.
slice
(prefix.
length
);
}
return
input;
}