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

推荐订阅源

P
Proofpoint News Feed
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
B
Blog RSS Feed
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
量子位
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
IT之家
IT之家
V
Visual Studio Blog
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
D
Docker
V
V2EX

博客园 - 丁丁

Running Knoppix 6.7.1 in a Sandisk Ultra flash drive to do GAE programming via PyCharm Fast fill huge number of same value to below cells in Excel How to install Windows 7 on the 6 years IBM X60 notebook Python 2.5 SSL package version 1.15 for GAE A GAE based blog, Micolog 7.412 with Django 1.2 enable Price compare: Sina App Engine vs Google App Engine IE9 is a little faster than Firefox6 in Speed Reading performance test but so less SDLC (Systems Development Life Cycle) Brief Terminology & Workflow 成功凤凰刷机刷出诺基亚E5系统版本042.014纯净简体中文版 How to using Windows Live Writer on umbraco - 丁丁 用PowerShell强制添加IE本身无法添加的RSS Feeds Getting Help on WMI Methods - 丁丁 [PowerShell]One line to pack individual PDF file into their BaseName.RAR - 丁丁 My first time meet ORA-600 error, quite memorable moment. Camstar InSite 3 server transaction log file profiler, source code included Setting up the Matlab Database Toolbox to connecting to Oracle DB 在Ubuntu 8.04 x86_64上安装Oracle 10g XE和Oracle Application Express(apex) 3.1.1 合并不同WebService之间的相同对象类型 究竟何时买房才最合适?写于2008年3月
代码小片断,自动对文本分行的C#函数
丁丁 · 2008-02-01 · via 博客园 - 丁丁

相当简单的C#函数实现代码片断,按照最小行长度分行和断行(会超过最小行长度),曾用于自动给太长的Winform Tooltip断行。

private string MultiplineString(string instr, int line_length)
{
    
string remain = instr, multi_line="";
    
while(remain.Length > line_length)
    {
        
int space_pos = remain.IndexOf(' ', line_length);
        
if (space_pos == -1)
            
break;
        multi_line 
+= remain.Substring(0, space_pos) + "\r\n";
        remain 
= remain.Substring(space_pos + 1);
    }
    
return multi_line + remain;
}