//英文分号 String itmw=“avc;sdf”; //中文分号 //String item=“avc;sdf”; //indexOf的返回值为int,在字符串中寻找一个字的位置,也可以作为判断,该字的位置存在则正数,不存在则负数 //英文分号 int en = ess.indexOf(";"); //中文分号 int ch = ess.indexOf(";"); if(on1 !=-1){ //将分号转为逗号 String essone = ess.replace(";",","); .... const en=this.form.Imei.indexOf(';') const ch=this.form.Imei.indexOf(';') if (this.TtewText == '' && this.ToneText == '') { this.$refs.uNotify.warning('请填写商品类型的数量') } else if(en==-1 && ch==-1 ) { this.$refs.corrent.warning('请以正确格式填写设备号') }else { }
判断字符串是否包含特殊符号
最新推荐文章于 2023-12-18 11:22:16 发布