remove last
This commit is contained in:
@@ -92,7 +92,10 @@ export function copyProjectLink(projectId) {
|
||||
);
|
||||
}
|
||||
|
||||
export function removeLast(string) {
|
||||
let lastIndex = string.lastIndexOf(" ");
|
||||
return string.substring(0, lastIndex);
|
||||
export function removeLast(string = " ") {
|
||||
let arr = string.trim().split(" ");
|
||||
if (arr.length > 2) {
|
||||
return arr.slice(0, -1).join(" ");
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user