package work01.w1; /** * 使用类String类的分割split将给定字符串分割 * * @author Eric * @date 2012-9-13 */ public class StringSplit { public static void main(String[] args) { String str = "Solutions to selected exercises can be found in the electronic document The Thinking in Java Annotated Solution Guide, available for a small fee from BruceEckel"; String[] strs = str.split(" |,"); for (String t : strs) System.out.println(t); } }
