惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
罗磊的独立博客
The GitHub Blog
The GitHub Blog
L
LangChain Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
DataBreaches.Net
宝玉的分享
宝玉的分享
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
N
Netflix TechBlog - Medium
The Cloudflare Blog
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
美团技术团队
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog

博客园 - 风语战士

asp.net 命名规范 CSS 色彩值... 请问 CType和DirectCast函数有何区别 soundex RadMenu菜单的父节指定image - 风语战士 - 博客园 从数据库中存取二进制数据并显示 - 风语战士 - 博客园 vs2005 web.config大全 javascript中showModalDialog和showModelessDialog的使用 设为主页 - 风语战士 - 博客园 CSS样式表 表达是做为参数验证用 DataList翻页 .net安全防止写不规范字付 引用一个falsh使它显示出来 删除成功后.添加前.可判断 弹出另一页面 (转)VS2005(c#)项目调试问题解决方案集锦 常用正则表达式 在ASP.NET中使用Session常见问题集锦
截取字付串
风语战士 · 2007-12-25 · via 博客园 - 风语战士

public static string GetString(string str, int length )
        {
            int i = 0, j = 0;
            foreach (char chr in str)
            {
                if ((int)chr >30)
                {
                    i += 2;
                }
                else
                {
                    i++;
                }
                if (i > length)
                {
                    str = str.Substring(0, j) + "...";
                    break;
                }
                j++;
            }
            return str;

        }
        #endregion