//英文分号
String ess=“avc;sdf”;
//中文分号
//String ess=“avc;sdf”;
//indexOf的返回值为int,在字符串中寻找一个字的位置,也可以作为判断,该字的位置存在则正数,不存在则负数
//英文分号
 int on1 = ess.indexOf(";");
//中文分号
 int on2 = ess.indexOf("");
if(on1 !=-1){
//将分号转为逗号
String essone = ess.replace(";",",");
  ....  
}else if (on2 !=-1){
  ....  
}else{
  ....
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-01
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案