【原創】字符首字母大寫格式化函數

        private string FormatStringToUpper(string str)
        {
            if (str.Length > 0)
            {
                string str0 = str.Substring(0, 1);
                string str1 = str.Substring(1, str.Length - 1);

                return str0.ToUpper() + str1;
            }
            else
            {
                return str;
            }
        }

posted on 2008-08-26 17:41  巍巍边疆  阅读(415)  评论(0编辑  收藏  举报