このフォームに入力しました
test@test.com
および/またはこの形式で
test@test.com;test2@test.com
また
test@test.com;test2@test.com;test3@test.com
区切り文字なしでセルごとに1つの電子メールのみを含む文字列配列ですべてをトークン化する必要があります
;
トークン化する必要はありません。次を使用してsplit
ください。
String[] emails = { "test@test.com;test2@test.com;test3@test.com", "test@test.com" };
List<string> result = new ArrayList<String>();
for ( string listOfEmails : emails ) {
for( string email : listOfEmails.split(";") ) {
result.Add(email).
}
}
System.out.println(result);
そして、それはすべての場合に機能します。