Java examples for Collection Framework:Array Convert
Convert a space-separated string into an array of strings.
//package com.java2s; public class Main { /** //from w ww . j a v a 2s . c o m * Convert a space-separated string into an array of strings. * * @param msg String separated by spaces * @return String array of tokens in string. */ public static String[] GetTokens(String msg) { return msg.split("\\s+"); } }