且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从multilpe文本框中的单列中获取数据?

更新时间:2023-02-23 22:55:23

如何从多文本框中的单列中获取数据
您的问题标题是指检索单列值,而代码看起来就像是将多个值插入到单列中.根据标题,您需要从可能用逗号分隔的列中检索值.然后使用Split方法并获取可以根据需要分配的单独值.

Split返回一个字符串数组,其中包含主字符串的子字符串,这些子字符串由指定的Unicode字符数组的元素分隔.参数指定是否返回空数组元素.
参考: MSDN:拆分 [ C#拆分 [ ^ ]
how to fetch data from single column in multilpe text boxes
Your question title speaks of retrieving single column value whereas code looks like inserting multiple values into a single column. Based on title, you need to retrieve the value from a column which probably will be comma separated. Then use Split method and get separate values that can be assigned as per need.

Split returns a string array that contains the substrings of the main string that are delimited by elements of a specified Unicode character array. A parameter specifies whether to return empty array elements.
Refer: MSDN: Split[^]

Sample: C# Split[^]