mirror of
https://github.com/ChatGPTNextWeb/NextChat.git
synced 2026-02-03 08:27:43 +08:00
feat: add multi-model support
This commit is contained in:
19
app/utils/string.ts
Normal file
19
app/utils/string.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export function trimEnd(s: string, end = " ") {
|
||||
if (end.length === 0) return s;
|
||||
|
||||
while (s.endsWith(end)) {
|
||||
s = s.slice(0, -end.length);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
export function trimStart(s: string, start = " ") {
|
||||
if (start.length === 0) return s;
|
||||
|
||||
while (s.endsWith(start)) {
|
||||
s = s.slice(start.length);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
Reference in New Issue
Block a user