解析和拆分字符串(Parsing and splitting a String)
我想格式化一个字符串“Event”
当我打印它。 它给我的结果如下:
When : Wed 18 Apr 2012 04:30 to Wed 18 Apr 2012 06:30 Who: test@gmail.com Event status : Confirmed.它给出了这三个类别的答案。
Who,when and Event Status 。
但我希望这三个结果在一个单独的字符串。如何格式化这些字符串,以便我将单独得到它
I want to format one string "Event"
When I print it. it gives me result like :
When : Wed 18 Apr 2012 04:30 to Wed 18 Apr 2012 06:30 Who: test@gmail.com Event status : Confirmed.It gives answers in this 3 category.
Who,when and Event Status.
But i want these three results in a separate string .How to format these string so that i ll get it seperately
最满意答案
String[] parts = resultString.split("\n+");
这将通过输入( \n+表示一个或多个新行符号)拆分字符串,并将零件存储在parts数组中
String[] parts = resultString.split("\n+");
This will split your string by enters (\n+ means one or more new line symbol) and store parts in parts array
更多推荐
发布评论