成义随笔

关注

js中拆分类似于“aaa-bbb-ccc”字符

成义随笔

关注

阅读 46

2022-03-21

getString(obj, state){

var index=obj.lastIndexOf("\-");

if(state==0){

obj=obj.substring(0,index);

}else {

obj=obj.substring(index+1,obj.length);

}

return obj;

}

let str = “aaa-bbb-ccc”

let str1 = this.getCaption(str,0) //aaa

let str2 = item.name2 = this.getCaption(str,1) //bbb

let str3 = item.name2 = this.getCaption(str,2) //ccc

相关推荐

菜菜捞捞

Node.js中util.format()-类似于printf格式字符串

菜菜捞捞 181 0 0

RIOChing

linux shell判断字符串包含(类似于contains)

RIOChing 49 0 0

追风骚年

win命令:powershell中类似于grep的命令——findstr

追风骚年 34 0 0

A邱凌

java gui 类似于 tabcontrol的控件

A邱凌 13 0 0

at小涛

python实现类似于java中switch case的功能

at小涛 68 0 0

alanwhy

R语言有类似于SPSS 的界面么?

alanwhy 62 0 0

Fifi的天马行空

wpf 类似于Swiper用于内容滑动 Carousel 轮播

Fifi的天马行空 13 0 0

皮皮球场

【Pascal/Delphi】实现类似于glibc中的strrstr函数(反向查找字符串)

皮皮球场 46 0 0

无愠色

c++传纸条(类似于方格取数)

无愠色 32 0 0

拾杨梅记

iOS 开发,类似于流布局的按钮组

拾杨梅记 11 0 0

精彩评论(0)

0 0 举报