码迷,mamicode.com
首页 > 编程语言 > 详细

【C#】字符串与字符数组

时间:2015-11-12 20:07:31      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

  字符串与字符数组的相互转换。

 

  字符串转换成字符数组:

string ss="abcdefg";

char[] cc=ss.ToCharArray();
 
  字符数组转换成字符串:
//char [] cc 定义同前段代码
string s=new string(cc);

  

【C#】字符串与字符数组

标签:

原文地址:http://www.cnblogs.com/thomasgong027/p/4959990.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!