C#Cinvert Int [] into String [] [英] C# Cinvert Int[] into String[]

查看:55
本文介绍了C#Cinvert Int [] into String []的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone!



请告诉我如何在C#中将Int []数组转换为String []数组。请尽快告诉我。

解决方案

尝试Linq:

  int  [] inputs =  new   int  [] { 1  2  3  4 ,< span class =code-digit> 5 }; 
string [] outputs = inputs.Select(i = > i.ToString() ).ToArray();


请参阅Wes Aday和我自己的问题评论。你的帖子和评论没什么意义。无论你做什么,它总是归结为 System.Object.ToString(),被覆盖。



您可以使用数组逐个元素地自己完成。如果您有错误,请告诉我您做错了什么。由于您没有提供任何代码示例,我们可以假设任何内容。



现在,有一个现成的方法可以进行数组到数组的转换。现在,问题是:为什么不阅读原始的MSDN文档?哪里可以找到它?当然,唯一可以看的是 System.Array 上的文档:没有其他数组。 :-)

http:// msdn .microsoft.com / zh-CN / library / exc45z53%28v = vs.110%29.aspx [ ^ ]。



-SA

Hello Everyone!

Please Tell Me How To Convert Int[] Array Into String[] Array in C#. please Tell Me ASAP.

解决方案

Try Linq:

int[] inputs = new int[] {1, 2, 3, 4, 5};
string[] outputs = inputs.Select(i => i.ToString()).ToArray();


Please see the comments to the question, by Wes Aday and myself. Your post and comments make little sense. No matter what you do, it always boils down to System.Object.ToString(), overridden.

You could do it by yourself with an array, element by element. If you had "errors", let me suggest that you did something wrong. As you did not provide any code sample, we could assume anything.

Now, there is a ready-to-use method which does the array-to-array conversion. Now, the problem is: why not reading original MSDN documentation? Where to find it? Naturally, the only place to look would be documentation on System.Array: there is no other arrays. :-)
http://msdn.microsoft.com/en-us/library/exc45z53%28v=vs.110%29.aspx[^].

—SA


这篇关于C#Cinvert Int [] into String []的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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