I have a string value
string str1 = "1,2"
and a Long List
List
I want to add this string value to List,without using loop,how this could be done? please do let me know about the same
I have a string value
string str1 = "1,2"
and a Long List
List
I want to add this string value to List,without using loop,how this could be done? please do let me know about the same
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted May 6, 2022, 2:47 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted May 6, 2022, 4:47 AM EDT
Hi Aniket,
You can achieve this using string split and convert ot list,
if you wish to create list of string then you can do like below
or
If you wish to conver list of long values then you can do below
Jignesh KumarRank #91 · 22.9K reputationPosted May 6, 2022, 5:03 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted May 6, 2022, 4:50 AM EDT
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted May 6, 2022, 6:58 AM EDT