http://www.moon4chen.com/
摘要: split用于分割字符串得到字串数组这是基本用法。如下: def str= "3 2" if(str.contains(" ")){ println str.split(' ')[0] // 3 } 可是换一种情况: def str= "3+2" if(str.contains("+")){ println str.split('+')[0] //报... 阅读全文
posted @ 2014-12-13 09:33 谌皓徽 阅读(466) 评论(0) 推荐(0)