首页 > 技术文章 > 截取字符串String

zhouweiye 2014-03-09 22:27 原文

def extension = fileName.split("\\.")[1]
String EXCEL_FILE_EXTENSIONS = " xls, xlsx "
if(EXCEL_FILE_EXTENSIONS.indexOf(extension)<0){
 
}
 
String payWay = subjectBox.getSelectedItem().value.toString()
String PAYMENT_MODE_EXTENSIONS = "银行"
if(payWay.indexOf(PAYMENT_MODE_EXTENSIONS)>-1){
    //println "code"
}

推荐阅读