C#文本问题 一个小问题,就是文本超出指定的长度时,显示省略号c# 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 static void Main(string[] args) { string result = 处理字符串("hello world hello world hello world hello world hello world hello world"); Console.WriteLine(result); } public static string 处理字符串(string str) { if (str.Length > 20) { return str.Substring(0, 20) + "..."; } return str; } 本帖最后由 caozhy 于 2013-08-27 15:03:40 编辑 能不能写一个函数什么的,直接调用 MemoryStream stream = new MemoryStream(b, true); 关于变量申明的问题 是使用一个变量(让这个变量的值变来变去 还是每遇到一块就申明一个变量?) 小case:---请问如何做一个类似任务提醒式的功能? 图片怎么保存,前辈们请赐教 (WindowForm)如何实现拖放功能? 高手赐教!请问怎样在TextBox控件Enabled属性为false时,设置其颜色,在线等待! 关于针式打印机的打印问题? C#时间格式转换问题 请问如何编写具有相同方法名称但带有不同个数的参数的方法? SQL语句查询问题 socket客户端连接不上服务器IP
{
string result = 处理字符串("hello world hello world hello world hello world hello world hello world");
Console.WriteLine(result);
} public static string 处理字符串(string str)
{
if (str.Length > 20)
{
return str.Substring(0, 20) + "...";
}
return str;
}