分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
- String s3 = "Real-How-To";
- String [] temp = null;
- temp = s3.split("-");
- etShow.setText(temp[0] + " linc " + temp[1]);
但是要注意的是,如果使用"."、"|"、"^"等字符做分隔符时,要写成s3.split("\\^")的格式,
否则不能拆分。
参见http://www.rgagnon.com/javadetails/java-0438.html
中
split() is based on regex expression, a special attention is needed with some characters which have a special meaning in a regex expression.
For example :
String s3 = "Real.How.To";...temp = s3.split("\\.");orString s3 = "Real|How|To";...temp = s3.split("\\|");