Exemplo n.º 1
0
        /// <summary>
        /// 去除数值字符串的所有空格。
        /// </summary>
        /// <param name="numricString">数值字符串</param>
        /// <returns>String</returns>
        public static string NumricTrimAll(string numricString)
        {
            string text       = ConvertHelper.ToObjectString(numricString).Trim();
            string returnText = String.Empty;

            char[] chars = text.ToCharArray();
            for (int i = 0; i < chars.Length; i++)
            {
                if (chars[i].ToString() == "+" || chars[i].ToString() == "-" || DataValidate.IsDouble(chars[i].ToString()))
                {
                    returnText += chars[i].ToString();
                }
            }
            return(returnText);
        }