convert List<string> to 1,2,3,4,5

แนะนำ สอบถาม ภาษา C สำหรับผู้เริ่มต้น ภาษา Java ภาษา Python

Moderators: mindphp, ผู้ดูแลกระดาน

User avatar
jataz2
PHP Super Member
PHP Super Member
Posts: 251
Joined: 22/02/2011 11:48 am

convert List<string> to 1,2,3,4,5

Post by jataz2 »

string[] arryID = {"1", "2", "3", "4","5","6","7","8","9"};
List<string> lstID = arryID .ToList();

string input_id = string.Join(",", lstID .Select(d => d.ToString()).ToList());

ตัวแปร input_id จะมีค่าดังต่อไปนี้ : "1", "2", "3", "4","5","6","7","8","9"
  • Similar Topics
    Replies
    Views
    Last post

Return to “Programming - C/C++ & java & Python”

Who is online

Users browsing this forum: No registered users and 7 guests