如何拆分并将值分配给该值 [英] How to split and assign the values to that values

查看:81
本文介绍了如何拆分并将值分配给该值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的应用程序中,我从数据库中获取"d1234","d1234","d123"之类的值,我想拆分这些值,并保存诸如

''d1234'',
''d1234'',
''d1234'',
''d1234'',

谁能帮我解决这个问题.我想分割数据,并想以上述给定格式制作数据

在Advance中致谢

Hi,

In my application I am taking the values from the database like ''d1234'',''d1234'',''d123'', I want to split this values and I want to save the values like

''d1234'',
''d1234'',
''d1234'',
''d1234'',

Can any one help me to solve this issue. I want split the data And I want to make the data in the above given format

Thanks in Advance

推荐答案

您好,

Hello there,

string yourStringFromDB = "your,string,from,db";
//
// Split string on the base of ",". This will separate all the words.
//
string[] words = yourStringFromDB.Split( new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
foreach (string word in words)
{
    Console.WriteLine(word);
}



希望这对您有所帮助,

问候,
Umer



Hope this helps you out,

Regards,
Umer


您现在想对数据库中的字符串执行的操作就很清楚了…….
what u want to do with the string from database now make it clear ....


这篇关于如何拆分并将值分配给该值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆