拼接字符串,逗号分隔技巧

来源:互联网 发布:苏享茂 知乎 编辑:程序博客网 时间:2024/05/21 06:35


  StringBuffer buffer = new StringBuffer();
  if(invoiceLst.size()>0){
   buffer.append(invoiceLst.get(0).getInvoiceId());
   for(int i=1;i<invoiceLst.size();i++){
    buffer.append(",").append(invoiceLst.get(i).getInvoiceId());
   }
  }

原创粉丝点击