首页 > 编程知识 正文

java根据下标删除数组元素,java两个数组合并成一个新的数组

时间:2023-05-04 02:43:18 阅读:12144 作者:1659

publicarraylistgetinferfacelist (arraylisttasknamelists ) {

字符串接口名称=' ';

string splited工作表=' ';

arraylistinterfacenamelist=new ArrayList (;

//遍历获取作业名称list中的每个作业名称

任务名称列表:任务名称列表(for )。

slitedworktable=taskname list.get taskname (;

System.out.println (工作名称: ' splitedWorkTable );

//接口名称是指作业名称中除去前缀SPT_GESSPSBC-STOR_INFO后的名称

string [ ] split=splited worktable.split (' _ ';

遍历//int数组,得到分割作业名的各要素

for(intx=1; x split.length; x ) {

//首先判断该元素是否是最后

if(x==split.Length-1 ) {

//直接连接元素

接口名称=split [ x ];

} else{

//把元素和(连接起来

接口名称=split [ x ];

//split[1]=split[1].replace('-',' _ ' );

接口名称=' _ ';

}

}

接口名称列表. add (接口名称;

}

system.out.println (接口名称;

返回接口名称列表;

}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。