通过数值返回tab字符的组合

2016-01-02 11:48:29  访问(1760) 赞(0) 踩(0)


    /// <summary>
    /// 通过数值返回tab字符的组合
    /// </summary>
    /// <param name="theValue"></param>
    /// <returns></returns>
    protected string TabCharGetByLayer(int theValue)
    {
        if (theValue <= 0)
            return "";
        switch (theValue)
        {
            case 1:
                return "" + '\t';
            case 2:
                return "" + '\t' + '\t';
            case 3:
                return "" + '\t' + '\t' + '\t';
            case 4:
                return "" + '\t' + '\t' + '\t' + '\t';
            case 5:
                return "" + '\t' + '\t' + '\t' + '\t' + '\t';
            case 6:
                return "" + '\t' + '\t' + '\t' + '\t' + '\t' + '\t';
            case 7:
                return "" + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t';
            case 8:
                return "" + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t';
            case 9:
                return "" + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t';
            case 10:
                return "" + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t' + '\t';
            default:
                string str = "" + '\t';
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < theValue; ++i)
                {
                    sb.Append(str);
                }

                return sb.ToString();
        }
    }


标签:通过数值返回tab字符的组合 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)