【发布时间】:2014-12-06 06:29:00
【问题描述】:
In my program a string is generated like this: Energie 670 kJ / 160 kcal
So how to write split function in java code and the first keyword Energie should print
the outputs?
输入:
Energie 670 kJ / 160 kcal预期输出:
1) Energie 670 kJ 2) Energie 160 kcal
如果有人有解决此问题的方法或更好的方法来拆分 串两次?
提前致谢
【问题讨论】:
-
您知道它是一个
String,并且您希望对其进行一些操作。阅读 API:docs.oracle.com/javase/7/docs/api/java/lang/String.html。这样你就可以学到更多。 Stackoverflow 不能替代 API 文档。