gpt4 book ai didi

java - 从输入分隔值中获取数组

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:03:09 25 4
gpt4 key购买 nike

我有一个带有输入分隔值的 TextArea:

例如:

Value1Value2Value3Value4Value5

Is there a fast way to put them in a String array

String[] newStringArray = ???

最佳答案

使用String.split() .如果您的 TextArea 名为 textArea,请执行以下操作:

String[] values = textArea.getText().split("\n");

关于java - 从输入分隔值中获取数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2956514/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com