通过数值(个数)返回tab字符的组合- TabCharGetByLayer

2017-06-06 19:29:59  访问(1709) 赞(0) 踩(0)


        /// <summary>
        /// 通过数值(个数)返回tab字符的组合- TabCharGetByLayer
        /// </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字符的组合- TabCharGetByLayer 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)
 
  ┈全部┈  
 
(显示默认分类)