theChar+theChar的连接 - LinkChar

2017-02-21 17:53:12  访问(1520) 赞(0) 踩(0)


        /// <summary>
        /// theChar+theChar的连接 - LinkChar +
        /// </summary>
        /// <param name="theChar"></param>
        /// <param name="linkRate"></param>
        /// <returns></returns>
        protected static string LinkChar(string theChar, int linkRate)
        {
            if(theChar==null||theChar.Length == 0)
                return "";

            switch(linkRate)
            {
                case 0:
                    return "";
                case 1:
                    return theChar;
                case 2:
                    return theChar +theChar;
                case 3:
                    return theChar+theChar+theChar;
                case 4:
                    return theChar+theChar+theChar+theChar;
                case 5:
                    return theChar+theChar+theChar+theChar+theChar;
                default:
                    StringBuilder theResult = new StringBuilder();

                    for(int i = 0;i<linkRate;++i)
                    {
                        theResult.Append(theChar);
                    }

                    return theResult.ToString();
            }
        }


标签:theChar+theChar的连接 - LinkChar 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)