Add profile links.

This commit is contained in:
Yang Luo
2021-02-14 22:49:06 +08:00
parent 65eee22099
commit 906fe9758e
2 changed files with 28 additions and 0 deletions

View File

@ -25,3 +25,20 @@ export function showMessage(type, text) {
message.error(text);
}
}
export function trim(str, ch) {
if (str === undefined) {
return undefined;
}
let start = 0;
let end = str.length;
while(start < end && str[start] === ch)
++start;
while(end > start && str[end - 1] === ch)
--end;
return (start > 0 || end < str.length) ? str.substring(start, end) : str;
}