-5
我想迭代accountset
List<AccountTO>
的值並將其設置爲AccountID
。如何在for循環中將Set <String>值添加到列表中?
其實在accountset
我得到的值:100,101,102
我想添加值的List<AccounTO>
,並將其設置爲AccountID
,並把它傳遞給服務調用。有沒有我可以去的地方,或者其他任何程序。
for(String s :group.getAccounts().keySet())
{
System.out.println("===="+s.lastIndexOf("-"));
System.out.println("sub"+s.substring(0,s.lastIndexOf("-")));
accountSet.add(s.substring(0, s.lastIndexOf("-")));
}
問題結構真的很差,解決方案可能是簡單的,如果你會把精力在寫你的問題好一點 – ant
@prashanth請重新格式化你的問題,並更好地解釋它,我不明白什麼是輸入和代碼應該做什麼 – dbf
設置 accountSet = new HashSet ();我需要將帳戶集添加到列表 –