2012年12月23日
摘要: 方法1:在后台处理:// 截取指定长度的字符串public static string GetContent(string content,int length){ if (string.IsNullOrEmpty(content)) { return ""; } else { if (content.Length>length) { content = content.Substring(0, length) + "..."; } return content; }... 阅读全文
posted @ 2012-12-23 13:49 Frank.Fan 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 交换两个数字: 1 using System; 2 3 namespace ConsoleApplication 4 { 5 class Program 6 { 7 static void Main(string[] args) 8 { 9 // 交换2个数字的方法10 11 int a = 3, b = 5;12 int c = 0;13 14 // 方法1:借助第三方临时变量15 // 有点:阅读性强,开发时使用.16 ... 阅读全文
posted @ 2012-12-23 13:08 Frank.Fan 阅读(323) 评论(0) 推荐(0) 编辑