Syste.Text.Encoding.GetBytes(aa).length
解决方案 »
- 关于索引器
- datagridview选择行的上下调整(包括光标)
- 分页用户控件的问题
- 发布部署2005写的winform成功后,怎么设置可以让生成的程序安装时候在开始 程序中出现
- 多线程如何通讯,
- 关于引用DLL的显示摘要说明的解决方法
- 高分求助 UP者有分 http://community.csdn.net/Expert/topic/3837/3837588.xml?temp=.653866
- 关于DataAdapter的问题
- wpf中怎么根据右键获取触发的源控件?
- 小弟我想做一个聊天程序,但对SOCKET不懂,有哪位大哥有相关示例我吗?或相关网站,谢谢!
- java读取C#写入的二进制文件出错
- 我想把PPS文件放在服务器上,通过浏览器(装插件或客户端都可以)观看。做得象视频流一样,边下载边观看。可以吗?
MessageBox.Show(aa.Length.ToString());
int i=aa.Length;
MessageBox.Show(System.Text.Encoding.Default.GetBytes(aa).Length.ToString());
MessageBox.Show(aa.Length.ToString());
ToString()可加可不加
using System.Collections.Generic;
using System.Text;namespace StringLength
{
class Program
{
static void Main(string[] args)
{
string aa = "we1223";
Console.WriteLine("aa的长度是:"+aa.Length.ToString());
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;namespace StringLength
{
class Program
{
static void Main(string[] args)
{
string aa = "we1223";
Console.WriteLine("aa的长度是:"+aa.Length.ToString());
Console.ReadLine();
}
}
}