Skip to content

Commit 15d4fc2

Browse files
author
徐煜东
committed
fix(bpm):缺少了subString 方法,应该是商城功能改subString这个工具类,不小心影响了bpm的功能
1 parent e289d5c commit 15d4fc2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/utils/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,3 +536,18 @@ export const sliceName = (name: string, start: number, end: number) => {
536536
}
537537
return name
538538
}
539+
540+
/**
541+
* 截取字符串
542+
*
543+
* @param str 字符串
544+
* @param start 开始位置
545+
* @param end 结束位置
546+
*/
547+
548+
export const subString = (str: string, start: number, end: number) => {
549+
if (str.length > end) {
550+
return str.slice(start, end)
551+
}
552+
return str
553+
}

0 commit comments

Comments
 (0)