วิธีที่จะแสดงวัตถุต้องรายการข้อความใน c#

รหัสตัวอย่าง

0
0

รายการแสดง<>c#

There are many ways to do that, I think there are two you should consider:

You can use Cast and ToList, but it will require using System.Linq.

var listOfStrings = new List<string>() { "foo", "bar" };
var listOfObjects = listOfStrings.Cast<object>().ToList();

To avoid that, you can use new List<T>(IEnumerable<T> source) constructor. Because IEnumerable<T> is covariant, you can do following:

var listOfStrings = new List<string>() { "foo", "bar" };
var listOfObjects = new List<object>(listOfString);

หน้าคล้ายกัน

คล้ายกันหน้ากับตัวอย่าง

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................

ดังอยู่ในนี้หมวดหมู่

ดังหน้ากับตัวอย่างอยู่ในหมวดหมู่