首页 > 代码库 > java的字符串截取

java的字符串截取

import java.util.Date;
import java.text.SimpleDateFormat;
Date now = new Date();
def portcodes = new StringBuffer(‘‘)
for(portcode in params.fsetcode)
{
portcodes << ‘‘
portcodes << portcode
portcodes << ‘,‘
}
params[‘portcodes‘]=portcodes1.substring(0, portcodes.length() - 1)
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");//可以方便地修改日期格式
def hehe = dateFormat.format( now );
params[‘dqsj‘] = hehe
if (params.fsetcode.size() == 1) { params[‘portcodeIfSingle‘] = ‘-‘ << params.fsetcode.getAt(0) }
else { params[‘portcodeIfSingle‘] = ‘‘ }
return true

java的字符串截取