如何使用 Java 标准 API 从字符串中获取特定数据?
我有以下模式:
Jan(COMPANY) &^% Feb(ASP) 567 Mar(INC)
我希望最终输出为:
String[] one = {"Jan", "Feb", "Mar"};
String[] two = {"COMPANY","ASP","INC"};
请帮忙。有人吗!!
I have the following pattern:
Jan(COMPANY) &^% Feb(ASP) 567 Mar(INC)
I want the final output to be:
String[] one = {"Jan", "Feb", "Mar"};
String[] two = {"COMPANY","ASP","INC"};
Please help. Anyone!!?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将结果存储在
String[] one
和String[] Two
中的完整示例如下所示:A complete example that stores the results in
String[] one
andString[] two
would look like this:遍历字符串中的字符并存储您需要的内容。
Iterate across the characters in the string and store what you need.