字符串数组到字符串 [英] String array to string
本文介绍了字符串数组到字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨先生/女士
我对C#中的字符串有疑问
假设一个字符串数组a []的值为0 ,1,2
现在我需要将此字符串数组转换为字符串(即假设字符串s = 012)
我怎么能实现这一点......我对C#很新,请帮助我..
谢谢inadvance
解决方案
试试这个,,,, :)
string [ ] ids = { 2343, 2344, 2345} ;
string idString = String .Join( ,,ids);
Response.Write(idString);
你可以试试这个:
string [] _str = new string [] { a, b, < span class =code-string> c};
string val = string .Concat(_str);
查看所有字符串操作函数的链接
http: //www.blackwasp.co.uk/SimpleStringManipulation.aspx [ ^ ]
Hi Sir/Madam
I have a doubt about string in C#
Let Say a String array a[] have values 0,1,2
now i need to convert this string array to string(ie let say string s=012)
How can i acheive this...I am very new to C# and please Help me..
Thanks inadvance
解决方案
Try this,,,,:)
string[] ids = { "2343", "2344", "2345" }; string idString = String.Join(",", ids); Response.Write(idString);
Hi,
you can try this:
string[] _str = new string[]{"a","b","c"}; string val = string.Concat(_str);
See this link for all string manipulation functions
http://www.blackwasp.co.uk/SimpleStringManipulation.aspx[^]
这篇关于字符串数组到字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文