高分求助!C#中连接字符串的方法(新手工作急用,在线等。)

[复制链接]
查看11 | 回复5 | 2013-2-27 14:56:20 | 显示全部楼层 |阅读模式
写个简单的吧 StringBuilder sb = new StringBuilder()for (int i = 0; i < length - str.Length; i++)sb.Append(fill);sb.Append(str);return sb.ToString();...
回复

使用道具 举报

千问 | 2013-2-27 14:56:20 | 显示全部楼层
public string fillLeft(string str,string fill,int length){
StringBuilder strb = new StringBuilder(length);
int count = length - str.Length;
for (int i = 0; i <co...
回复

使用道具 举报

千问 | 2013-2-27 14:56:20 | 显示全部楼层
while(str.length()<=length){
str = fill+str;}...
回复

使用道具 举报

千问 | 2013-2-27 14:56:20 | 显示全部楼层
"abc".ToString("00000");...
回复

使用道具 举报

千问 | 2013-2-27 14:56:20 | 显示全部楼层
string str = "abc";
string str1 = "0";
int len = 6;
int j = len - str.Length;
string result = str;
for (int i = 0; i < j; i++)
...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行