摘要: 方法一:public static string GetString(string str, int length){int i = 0, j = 0;foreach(char chr in str){if((int)chr > 127){i += 2;}else{i ++;}if (i > length){str = str.Substring(0, j) + "...";break;}j ++;}return str;}方法二public static string stringformat(string str,int n){//////格式化字符串长度, 阅读全文
posted @ 2012-10-11 13:06 大脸 阅读(320) 评论(0) 推荐(0) 编辑