如何将任何数组转换为字符串 [英] how to convert any array to string

查看:89
本文介绍了如何将任何数组转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将任何char数组转换为字符串格式?

How to convert any array of char to string format???

推荐答案

最简单的方法就是使用字符串constuctor:
Easiest way is just use the string constuctor:
var chars = new[] {  'a', 'b', 'c', 'd'  };
var str = new string(chars);


//chars是您的char数组
//chars is ur char array
string s = new string(chars);


^ ]
http://www.dotnetperls.com/convert-char-array-string [ ^ ]
http://www.c-sharpcorner.com/UploadFile/mahesh/convert-char-array-to-string-in-C-Sharp/[^]
http://www.dotnetperls.com/convert-char-array-string[^]


这篇关于如何将任何数组转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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